From 7435de3aa82fb05106c682ff7364ff071a0eba6b Mon Sep 17 00:00:00 2001 From: Kyle Dodson Date: Sun, 1 Sep 2024 01:23:26 -0700 Subject: [PATCH] Add SDK project, example, and documentation --- .devcontainer/devcontainer.json | 24 + .../{publish-package.yml => publish.yml} | 25 +- .gitignore | 150 ++ .manifest.json | 570 +++++ .nvmrc | 1 + LICENSE | 21 + README.md | 177 +- documentation/models/Container.md | 127 ++ documentation/models/ContainerGroup.md | 26 + .../models/ContainerGroupInstance.md | 29 + .../ContainerGroupInstanceStatusCount.md | 12 + .../models/ContainerGroupInstances.md | 9 + documentation/models/ContainerGroupList.md | 9 + .../models/ContainerGroupLivenessProbe.md | 17 + .../models/ContainerGroupNetworking.md | 12 + .../models/ContainerGroupPriority.md | 10 + .../models/ContainerGroupProbeExec.md | 7 + .../models/ContainerGroupProbeGrpc.md | 8 + .../models/ContainerGroupProbeHttp.md | 10 + .../models/ContainerGroupProbeHttpHeaders2.md | 8 + .../models/ContainerGroupProbeTcp.md | 7 + .../models/ContainerGroupQueueConnection.md | 11 + .../models/ContainerGroupReadinessProbe.md | 17 + .../models/ContainerGroupStartupProbe.md | 17 + documentation/models/ContainerGroupState.md | 13 + documentation/models/ContainerGroupStatus.md | 12 + documentation/models/ContainerGroupsQuotas.md | 11 + .../models/ContainerNetworkingProtocol.md | 7 + .../models/ContainerProbeHttpScheme.md | 7 + .../models/ContainerResourceRequirements.md | 12 + .../models/ContainerRestartPolicy.md | 9 + documentation/models/CountryCode.md | 255 +++ documentation/models/CreateContainer.md | 181 ++ documentation/models/CreateContainerGroup.md | 20 + .../models/CreateContainerGroupNetworking.md | 11 + .../models/CreateInferenceEndpointJob.md | 11 + documentation/models/CreateQueue.md | 11 + documentation/models/CreateQueueJob.md | 11 + documentation/models/GpuClass.md | 12 + documentation/models/GpuClassPrice.md | 10 + documentation/models/GpuClassesList.md | 9 + documentation/models/InferenceEndpoint.md | 16 + documentation/models/InferenceEndpointJob.md | 31 + .../models/InferenceEndpointJobEvent.md | 22 + .../models/InferenceEndpointJobList.md | 9 + .../models/InferenceEndpointsList.md | 9 + documentation/models/Queue.md | 15 + documentation/models/QueueJob.md | 29 + documentation/models/QueueJobEvent.md | 22 + documentation/models/QueueJobList.md | 9 + documentation/models/QueueList.md | 9 + documentation/models/Quotas.md | 12 + documentation/models/RecipesQuotas.md | 8 + documentation/models/UpdateContainer.md | 192 ++ documentation/models/UpdateContainerGroup.md | 16 + .../models/UpdateContainerGroupNetworking.md | 9 + documentation/models/UpdateQueue.md | 10 + documentation/models/WebhookSecretKey.md | 9 + documentation/models/WorkloadError.md | 15 + documentation/models/WorkloadErrorList.md | 9 + .../services/ContainerGroupsService.md | 888 ++++++++ .../services/InferenceEndpointsService.md | 242 +++ .../services/OrganizationDataService.md | 40 + documentation/services/QueuesService.md | 387 ++++ documentation/services/QuotasService.md | 40 + .../services/WebhookSecretKeyService.md | 78 + .../services/WorkloadErrorsService.md | 46 + ...ons-{organization_name}-gpu-classes-get.md | 13 + ...anization_name}-inference-endpoints-get.md | 16 + ...endpoints-{inference_endpoint_name}-get.md | 13 + ...ints-{inference_endpoint_name}-jobs-get.md | 16 + ...nts-{inference_endpoint_name}-jobs-post.md | 23 + ...jobs-{inference_endpoint_job_id}-delete.md | 17 + ...e}-jobs-{inference_endpoint_job_id}-get.md | 17 + ...-projects-{project_name}-containers-get.md | 16 + ...projects-{project_name}-containers-post.md | 235 ++ ...ontainers-{container_group_name}-delete.md | 17 + ...iners-{container_group_name}-errors-get.md | 17 + ...}-containers-{container_group_name}-get.md | 17 + ...rs-{container_group_name}-instances-get.md | 17 + ...ances-{container_group_instance_id}-get.md | 18 + ...iner_group_instance_id}-reallocate-post.md | 18 + ...tainer_group_instance_id}-recreate-post.md | 18 + ...ntainer_group_instance_id}-restart-post.md | 18 + ...containers-{container_group_name}-patch.md | 218 ++ ...iners-{container_group_name}-start-post.md | 17 + ...ainers-{container_group_name}-stop-post.md | 17 + ...ame}-projects-{project_name}-queues-get.md | 16 + ...me}-projects-{project_name}-queues-post.md | 23 + ...roject_name}-queues-{queue_name}-delete.md | 17 + ...-{project_name}-queues-{queue_name}-get.md | 17 + ...ject_name}-queues-{queue_name}-jobs-get.md | 21 + ...ect_name}-queues-{queue_name}-jobs-post.md | 24 + ...{queue_name}-jobs-{queue_job_id}-delete.md | 18 + ...es-{queue_name}-jobs-{queue_job_id}-get.md | 18 + ...project_name}-queues-{queue_name}-patch.md | 23 + ...izations-{organization_name}-quotas-get.md | 13 + ...ganization_name}-webhook-secret-key-get.md | 15 + ...anization_name}-webhook-secret-key-post.md | 15 + examples/README.md | 27 + examples/package.json | 18 + examples/src/index.ts | 11 + examples/tsconfig.json | 22 + package-lock.json | 1936 +++++++++++++++++ package.json | 43 + src/http/client.ts | 39 + src/http/environment.ts | 3 + src/http/error.ts | 12 + src/http/handlers/auth-handler.ts | 35 + src/http/handlers/handler-chain.ts | 22 + src/http/handlers/hook-handler.ts | 38 + .../handlers/request-validation-handler.ts | 72 + .../handlers/response-validation-handler.ts | 106 + src/http/handlers/retry-handler.ts | 40 + src/http/handlers/terminating-handler.ts | 10 + src/http/hooks/custom-hook.ts | 32 + src/http/hooks/hook.ts | 40 + src/http/index.ts | 1 + src/http/serialization/base-serializer.ts | 139 ++ src/http/serialization/header-serializer.ts | 19 + src/http/serialization/path-serializer.ts | 12 + src/http/serialization/query-serializer.ts | 18 + src/http/transport/request-builder.ts | 164 ++ src/http/transport/request-fetch-adapter.ts | 88 + src/http/transport/request.ts | 209 ++ src/http/transport/transport-hook-adapter.ts | 85 + src/http/types.ts | 70 + src/index.ts | 108 + src/services/base-service.ts | 31 + .../container-group-instance-status-count.ts | 63 + .../common/container-group-liveness-probe.ts | 113 + .../common/container-group-networking.ts | 63 + .../common/container-group-priority.ts | 8 + .../common/container-group-probe-exec.ts | 41 + .../common/container-group-probe-grpc.ts | 46 + .../container-group-probe-http-headers-2.ts | 46 + .../common/container-group-probe-http.ts | 68 + .../common/container-group-probe-tcp.ts | 41 + .../container-group-queue-connection.ts | 61 + .../common/container-group-readiness-probe.ts | 113 + .../common/container-group-startup-probe.ts | 113 + src/services/common/container-group-state.ts | 74 + src/services/common/container-group-status.ts | 10 + src/services/common/container-group.ts | 190 ++ src/services/common/container-logging.ts | 81 + .../common/container-networking-protocol.ts | 5 + .../common/container-probe-http-scheme.ts | 5 + .../common/container-resource-requirements.ts | 63 + .../common/container-restart-policy.ts | 7 + src/services/common/container.ts | 93 + src/services/common/country-code.ts | 253 +++ src/services/common/datadog-tags-1.ts | 46 + src/services/common/http-compression-1.ts | 6 + src/services/common/http-format-1.ts | 6 + src/services/common/http-headers-1.ts | 46 + src/services/common/index.ts | 32 + src/services/common/logging-axiom-1.ts | 53 + src/services/common/logging-datadog-1.ts | 54 + src/services/common/logging-http-1.ts | 88 + src/services/common/logging-new-relic-1.ts | 46 + src/services/common/logging-splunk-1.ts | 46 + src/services/common/logging-tcp-1.ts | 46 + .../container-groups/container-groups.ts | 531 +++++ src/services/container-groups/index.ts | 2 + .../models/container-group-instance.ts | 81 + .../models/container-group-instances.ts | 46 + .../models/container-group-list.ts | 42 + .../create-container-group-networking.ts | 53 + .../models/create-container-group.ts | 157 ++ .../models/create-container-logging.ts | 81 + ...reate-container-registry-authentication.ts | 94 + .../models/create-container.ts | 96 + .../container-groups/models/datadog-tags-2.ts | 46 + .../container-groups/models/datadog-tags-3.ts | 46 + .../models/http-compression-2.ts | 6 + .../models/http-compression-3.ts | 6 + .../container-groups/models/http-format-2.ts | 6 + .../container-groups/models/http-format-3.ts | 6 + .../container-groups/models/http-headers-3.ts | 46 + .../container-groups/models/http-headers-4.ts | 46 + src/services/container-groups/models/index.ts | 45 + .../models/logging-axiom-2.ts | 53 + .../models/logging-axiom-3.ts | 53 + .../models/logging-datadog-2.ts | 54 + .../models/logging-datadog-3.ts | 54 + .../container-groups/models/logging-http-2.ts | 88 + .../container-groups/models/logging-http-3.ts | 88 + .../models/logging-new-relic-2.ts | 46 + .../models/logging-new-relic-3.ts | 46 + .../models/logging-splunk-2.ts | 46 + .../models/logging-splunk-3.ts | 46 + .../container-groups/models/logging-tcp-2.ts | 46 + .../container-groups/models/logging-tcp-3.ts | 46 + .../registry-authentication-aws-ecr-1.ts | 46 + .../registry-authentication-aws-ecr-2.ts | 46 + .../models/registry-authentication-basic-1.ts | 46 + .../models/registry-authentication-basic-2.ts | 46 + .../registry-authentication-docker-hub-1.ts | 46 + .../registry-authentication-docker-hub-2.ts | 46 + .../registry-authentication-gcp-gar-1.ts | 41 + .../registry-authentication-gcp-gar-2.ts | 41 + .../registry-authentication-gcp-gcr-1.ts | 41 + .../registry-authentication-gcp-gcr-2.ts | 41 + .../container-groups/models/resources.ts | 63 + src/services/container-groups/models/state.ts | 9 + .../update-container-group-networking.ts | 41 + .../models/update-container-group.ts | 120 + .../models/update-container-logging.ts | 81 + ...pdate-container-registry-authentication.ts | 94 + .../models/update-container.ts | 92 + src/services/inference-endpoints/index.ts | 2 + .../inference-endpoints.ts | 258 +++ .../models/create-inference-endpoint-job.ts | 53 + .../inference-endpoints/models/index.ts | 8 + .../inference-endpoint-job-event-action.ts | 9 + .../models/inference-endpoint-job-event.ts | 46 + .../models/inference-endpoint-job-list.ts | 46 + .../models/inference-endpoint-job-status.ts | 9 + .../models/inference-endpoint-job.ts | 110 + .../models/inference-endpoint.ts | 95 + .../models/inference-endpoints-list.ts | 42 + .../inference-endpoints/request-params.ts | 9 + src/services/organization-data/index.ts | 2 + .../models/gpu-class-price.ts | 46 + .../organization-data/models/gpu-class.ts | 64 + .../models/gpu-classes-list.ts | 42 + .../organization-data/models/index.ts | 3 + .../organization-data/organization-data.ts | 34 + src/services/queues/index.ts | 2 + .../queues/models/create-queue-job.ts | 53 + src/services/queues/models/create-queue.ts | 73 + src/services/queues/models/index.ts | 10 + .../queues/models/queue-job-event-action.ts | 9 + src/services/queues/models/queue-job-event.ts | 46 + src/services/queues/models/queue-job-list.ts | 42 + .../queues/models/queue-job-status.ts | 9 + src/services/queues/models/queue-job.ts | 94 + src/services/queues/models/queue-list.ts | 42 + src/services/queues/models/queue.ts | 98 + src/services/queues/models/update-queue.ts | 58 + src/services/queues/queues.ts | 404 ++++ src/services/queues/request-params.ts | 4 + src/services/quotas/index.ts | 2 + .../quotas/models/container-groups-quotas.ts | 69 + src/services/quotas/models/index.ts | 3 + src/services/quotas/models/quotas.ts | 69 + src/services/quotas/models/recipes-quotas.ts | 48 + src/services/quotas/quotas.ts | 34 + src/services/webhook-secret-key/index.ts | 2 + .../webhook-secret-key/models/index.ts | 1 + .../models/webhook-secret-key.ts | 41 + .../webhook-secret-key/webhook-secret-key.ts | 66 + src/services/workload-errors/index.ts | 2 + src/services/workload-errors/models/index.ts | 2 + .../models/workload-error-list.ts | 42 + .../workload-errors/models/workload-error.ts | 81 + .../workload-errors/workload-errors.ts | 49 + tsconfig.json | 22 + 258 files changed, 15918 insertions(+), 11 deletions(-) create mode 100644 .devcontainer/devcontainer.json rename .github/workflows/{publish-package.yml => publish.yml} (58%) create mode 100644 .manifest.json create mode 100644 .nvmrc create mode 100644 LICENSE create mode 100644 documentation/models/Container.md create mode 100644 documentation/models/ContainerGroup.md create mode 100644 documentation/models/ContainerGroupInstance.md create mode 100644 documentation/models/ContainerGroupInstanceStatusCount.md create mode 100644 documentation/models/ContainerGroupInstances.md create mode 100644 documentation/models/ContainerGroupList.md create mode 100644 documentation/models/ContainerGroupLivenessProbe.md create mode 100644 documentation/models/ContainerGroupNetworking.md create mode 100644 documentation/models/ContainerGroupPriority.md create mode 100644 documentation/models/ContainerGroupProbeExec.md create mode 100644 documentation/models/ContainerGroupProbeGrpc.md create mode 100644 documentation/models/ContainerGroupProbeHttp.md create mode 100644 documentation/models/ContainerGroupProbeHttpHeaders2.md create mode 100644 documentation/models/ContainerGroupProbeTcp.md create mode 100644 documentation/models/ContainerGroupQueueConnection.md create mode 100644 documentation/models/ContainerGroupReadinessProbe.md create mode 100644 documentation/models/ContainerGroupStartupProbe.md create mode 100644 documentation/models/ContainerGroupState.md create mode 100644 documentation/models/ContainerGroupStatus.md create mode 100644 documentation/models/ContainerGroupsQuotas.md create mode 100644 documentation/models/ContainerNetworkingProtocol.md create mode 100644 documentation/models/ContainerProbeHttpScheme.md create mode 100644 documentation/models/ContainerResourceRequirements.md create mode 100644 documentation/models/ContainerRestartPolicy.md create mode 100644 documentation/models/CountryCode.md create mode 100644 documentation/models/CreateContainer.md create mode 100644 documentation/models/CreateContainerGroup.md create mode 100644 documentation/models/CreateContainerGroupNetworking.md create mode 100644 documentation/models/CreateInferenceEndpointJob.md create mode 100644 documentation/models/CreateQueue.md create mode 100644 documentation/models/CreateQueueJob.md create mode 100644 documentation/models/GpuClass.md create mode 100644 documentation/models/GpuClassPrice.md create mode 100644 documentation/models/GpuClassesList.md create mode 100644 documentation/models/InferenceEndpoint.md create mode 100644 documentation/models/InferenceEndpointJob.md create mode 100644 documentation/models/InferenceEndpointJobEvent.md create mode 100644 documentation/models/InferenceEndpointJobList.md create mode 100644 documentation/models/InferenceEndpointsList.md create mode 100644 documentation/models/Queue.md create mode 100644 documentation/models/QueueJob.md create mode 100644 documentation/models/QueueJobEvent.md create mode 100644 documentation/models/QueueJobList.md create mode 100644 documentation/models/QueueList.md create mode 100644 documentation/models/Quotas.md create mode 100644 documentation/models/RecipesQuotas.md create mode 100644 documentation/models/UpdateContainer.md create mode 100644 documentation/models/UpdateContainerGroup.md create mode 100644 documentation/models/UpdateContainerGroupNetworking.md create mode 100644 documentation/models/UpdateQueue.md create mode 100644 documentation/models/WebhookSecretKey.md create mode 100644 documentation/models/WorkloadError.md create mode 100644 documentation/models/WorkloadErrorList.md create mode 100644 documentation/services/ContainerGroupsService.md create mode 100644 documentation/services/InferenceEndpointsService.md create mode 100644 documentation/services/OrganizationDataService.md create mode 100644 documentation/services/QueuesService.md create mode 100644 documentation/services/QuotasService.md create mode 100644 documentation/services/WebhookSecretKeyService.md create mode 100644 documentation/services/WorkloadErrorsService.md create mode 100644 documentation/snippets/organizations-{organization_name}-gpu-classes-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-inference-endpoints-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-post.md create mode 100644 documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-delete.md create mode 100644 documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-post.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-delete.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-errors-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-reallocate-post.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-recreate-post.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-restart-post.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-patch.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-start-post.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-stop-post.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-post.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-delete.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-post.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-delete.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-patch.md create mode 100644 documentation/snippets/organizations-{organization_name}-quotas-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-webhook-secret-key-get.md create mode 100644 documentation/snippets/organizations-{organization_name}-webhook-secret-key-post.md create mode 100644 examples/README.md create mode 100644 examples/package.json create mode 100644 examples/src/index.ts create mode 100644 examples/tsconfig.json create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 src/http/client.ts create mode 100644 src/http/environment.ts create mode 100644 src/http/error.ts create mode 100644 src/http/handlers/auth-handler.ts create mode 100644 src/http/handlers/handler-chain.ts create mode 100644 src/http/handlers/hook-handler.ts create mode 100644 src/http/handlers/request-validation-handler.ts create mode 100644 src/http/handlers/response-validation-handler.ts create mode 100644 src/http/handlers/retry-handler.ts create mode 100644 src/http/handlers/terminating-handler.ts create mode 100644 src/http/hooks/custom-hook.ts create mode 100644 src/http/hooks/hook.ts create mode 100644 src/http/index.ts create mode 100644 src/http/serialization/base-serializer.ts create mode 100644 src/http/serialization/header-serializer.ts create mode 100644 src/http/serialization/path-serializer.ts create mode 100644 src/http/serialization/query-serializer.ts create mode 100644 src/http/transport/request-builder.ts create mode 100644 src/http/transport/request-fetch-adapter.ts create mode 100644 src/http/transport/request.ts create mode 100644 src/http/transport/transport-hook-adapter.ts create mode 100644 src/http/types.ts create mode 100644 src/index.ts create mode 100644 src/services/base-service.ts create mode 100644 src/services/common/container-group-instance-status-count.ts create mode 100644 src/services/common/container-group-liveness-probe.ts create mode 100644 src/services/common/container-group-networking.ts create mode 100644 src/services/common/container-group-priority.ts create mode 100644 src/services/common/container-group-probe-exec.ts create mode 100644 src/services/common/container-group-probe-grpc.ts create mode 100644 src/services/common/container-group-probe-http-headers-2.ts create mode 100644 src/services/common/container-group-probe-http.ts create mode 100644 src/services/common/container-group-probe-tcp.ts create mode 100644 src/services/common/container-group-queue-connection.ts create mode 100644 src/services/common/container-group-readiness-probe.ts create mode 100644 src/services/common/container-group-startup-probe.ts create mode 100644 src/services/common/container-group-state.ts create mode 100644 src/services/common/container-group-status.ts create mode 100644 src/services/common/container-group.ts create mode 100644 src/services/common/container-logging.ts create mode 100644 src/services/common/container-networking-protocol.ts create mode 100644 src/services/common/container-probe-http-scheme.ts create mode 100644 src/services/common/container-resource-requirements.ts create mode 100644 src/services/common/container-restart-policy.ts create mode 100644 src/services/common/container.ts create mode 100644 src/services/common/country-code.ts create mode 100644 src/services/common/datadog-tags-1.ts create mode 100644 src/services/common/http-compression-1.ts create mode 100644 src/services/common/http-format-1.ts create mode 100644 src/services/common/http-headers-1.ts create mode 100644 src/services/common/index.ts create mode 100644 src/services/common/logging-axiom-1.ts create mode 100644 src/services/common/logging-datadog-1.ts create mode 100644 src/services/common/logging-http-1.ts create mode 100644 src/services/common/logging-new-relic-1.ts create mode 100644 src/services/common/logging-splunk-1.ts create mode 100644 src/services/common/logging-tcp-1.ts create mode 100644 src/services/container-groups/container-groups.ts create mode 100644 src/services/container-groups/index.ts create mode 100644 src/services/container-groups/models/container-group-instance.ts create mode 100644 src/services/container-groups/models/container-group-instances.ts create mode 100644 src/services/container-groups/models/container-group-list.ts create mode 100644 src/services/container-groups/models/create-container-group-networking.ts create mode 100644 src/services/container-groups/models/create-container-group.ts create mode 100644 src/services/container-groups/models/create-container-logging.ts create mode 100644 src/services/container-groups/models/create-container-registry-authentication.ts create mode 100644 src/services/container-groups/models/create-container.ts create mode 100644 src/services/container-groups/models/datadog-tags-2.ts create mode 100644 src/services/container-groups/models/datadog-tags-3.ts create mode 100644 src/services/container-groups/models/http-compression-2.ts create mode 100644 src/services/container-groups/models/http-compression-3.ts create mode 100644 src/services/container-groups/models/http-format-2.ts create mode 100644 src/services/container-groups/models/http-format-3.ts create mode 100644 src/services/container-groups/models/http-headers-3.ts create mode 100644 src/services/container-groups/models/http-headers-4.ts create mode 100644 src/services/container-groups/models/index.ts create mode 100644 src/services/container-groups/models/logging-axiom-2.ts create mode 100644 src/services/container-groups/models/logging-axiom-3.ts create mode 100644 src/services/container-groups/models/logging-datadog-2.ts create mode 100644 src/services/container-groups/models/logging-datadog-3.ts create mode 100644 src/services/container-groups/models/logging-http-2.ts create mode 100644 src/services/container-groups/models/logging-http-3.ts create mode 100644 src/services/container-groups/models/logging-new-relic-2.ts create mode 100644 src/services/container-groups/models/logging-new-relic-3.ts create mode 100644 src/services/container-groups/models/logging-splunk-2.ts create mode 100644 src/services/container-groups/models/logging-splunk-3.ts create mode 100644 src/services/container-groups/models/logging-tcp-2.ts create mode 100644 src/services/container-groups/models/logging-tcp-3.ts create mode 100644 src/services/container-groups/models/registry-authentication-aws-ecr-1.ts create mode 100644 src/services/container-groups/models/registry-authentication-aws-ecr-2.ts create mode 100644 src/services/container-groups/models/registry-authentication-basic-1.ts create mode 100644 src/services/container-groups/models/registry-authentication-basic-2.ts create mode 100644 src/services/container-groups/models/registry-authentication-docker-hub-1.ts create mode 100644 src/services/container-groups/models/registry-authentication-docker-hub-2.ts create mode 100644 src/services/container-groups/models/registry-authentication-gcp-gar-1.ts create mode 100644 src/services/container-groups/models/registry-authentication-gcp-gar-2.ts create mode 100644 src/services/container-groups/models/registry-authentication-gcp-gcr-1.ts create mode 100644 src/services/container-groups/models/registry-authentication-gcp-gcr-2.ts create mode 100644 src/services/container-groups/models/resources.ts create mode 100644 src/services/container-groups/models/state.ts create mode 100644 src/services/container-groups/models/update-container-group-networking.ts create mode 100644 src/services/container-groups/models/update-container-group.ts create mode 100644 src/services/container-groups/models/update-container-logging.ts create mode 100644 src/services/container-groups/models/update-container-registry-authentication.ts create mode 100644 src/services/container-groups/models/update-container.ts create mode 100644 src/services/inference-endpoints/index.ts create mode 100644 src/services/inference-endpoints/inference-endpoints.ts create mode 100644 src/services/inference-endpoints/models/create-inference-endpoint-job.ts create mode 100644 src/services/inference-endpoints/models/index.ts create mode 100644 src/services/inference-endpoints/models/inference-endpoint-job-event-action.ts create mode 100644 src/services/inference-endpoints/models/inference-endpoint-job-event.ts create mode 100644 src/services/inference-endpoints/models/inference-endpoint-job-list.ts create mode 100644 src/services/inference-endpoints/models/inference-endpoint-job-status.ts create mode 100644 src/services/inference-endpoints/models/inference-endpoint-job.ts create mode 100644 src/services/inference-endpoints/models/inference-endpoint.ts create mode 100644 src/services/inference-endpoints/models/inference-endpoints-list.ts create mode 100644 src/services/inference-endpoints/request-params.ts create mode 100644 src/services/organization-data/index.ts create mode 100644 src/services/organization-data/models/gpu-class-price.ts create mode 100644 src/services/organization-data/models/gpu-class.ts create mode 100644 src/services/organization-data/models/gpu-classes-list.ts create mode 100644 src/services/organization-data/models/index.ts create mode 100644 src/services/organization-data/organization-data.ts create mode 100644 src/services/queues/index.ts create mode 100644 src/services/queues/models/create-queue-job.ts create mode 100644 src/services/queues/models/create-queue.ts create mode 100644 src/services/queues/models/index.ts create mode 100644 src/services/queues/models/queue-job-event-action.ts create mode 100644 src/services/queues/models/queue-job-event.ts create mode 100644 src/services/queues/models/queue-job-list.ts create mode 100644 src/services/queues/models/queue-job-status.ts create mode 100644 src/services/queues/models/queue-job.ts create mode 100644 src/services/queues/models/queue-list.ts create mode 100644 src/services/queues/models/queue.ts create mode 100644 src/services/queues/models/update-queue.ts create mode 100644 src/services/queues/queues.ts create mode 100644 src/services/queues/request-params.ts create mode 100644 src/services/quotas/index.ts create mode 100644 src/services/quotas/models/container-groups-quotas.ts create mode 100644 src/services/quotas/models/index.ts create mode 100644 src/services/quotas/models/quotas.ts create mode 100644 src/services/quotas/models/recipes-quotas.ts create mode 100644 src/services/quotas/quotas.ts create mode 100644 src/services/webhook-secret-key/index.ts create mode 100644 src/services/webhook-secret-key/models/index.ts create mode 100644 src/services/webhook-secret-key/models/webhook-secret-key.ts create mode 100644 src/services/webhook-secret-key/webhook-secret-key.ts create mode 100644 src/services/workload-errors/index.ts create mode 100644 src/services/workload-errors/models/index.ts create mode 100644 src/services/workload-errors/models/workload-error-list.ts create mode 100644 src/services/workload-errors/models/workload-error.ts create mode 100644 src/services/workload-errors/workload-errors.ts create mode 100644 tsconfig.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..3a655c8 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,24 @@ +{ + "name": "Node.js & TypeScript", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm", + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "cd examples && npm run setup", + + // Configure tool-specific properties. + "customizations": { + "codespaces": { + "openFiles": ["README.md", "examples/src/index.ts"] + } + } + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish.yml similarity index 58% rename from .github/workflows/publish-package.yml rename to .github/workflows/publish.yml index ba878fa..c14bb7d 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Publish npm Package +name: Publish Package on: release: @@ -6,8 +6,8 @@ on: - published jobs: - build: - name: Build + test: + name: Test Package runs-on: ubuntu-latest steps: - name: Checkout @@ -15,15 +15,19 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version-file: .nvmrc cache: npm + cache-dependency-path: package-lock.json + registry-url: 'https://registry.npmjs.org' + scope: '@saladtechnologies-oss' + always-auth: 'true' - name: Install Dependencies run: npm ci - name: Test run: npm run test publish: - name: Publish - needs: build + name: Publish Package + needs: test runs-on: ubuntu-latest steps: - name: Checkout @@ -31,14 +35,15 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version-file: .nvmrc cache: npm cache-dependency-path: package-lock.json - registry-url: https://npm.pkg.github.com + registry-url: 'https://registry.npmjs.org' scope: '@saladtechnologies-oss' + always-auth: 'true' - name: Install Dependencies run: npm ci - name: Publish - run: npm publish + run: npm publish --access public env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index cae2ebb..2975456 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,153 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +## Node.gitignore +## https://github.com/github/gitignore + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +## VisualStudioCode.gitignore +## https://github.com/github/gitignore + +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix diff --git a/.manifest.json b/.manifest.json new file mode 100644 index 0000000..e5e2871 --- /dev/null +++ b/.manifest.json @@ -0,0 +1,570 @@ +{ + "liblabVersion": "2.1.30", + "date": "2024-08-31T20:15:31.053Z", + "config": { + "apiId": 1094, + "sdkName": "salad-cloud-sdk", + "sdkVersion": "0.9.0-alpha.1", + "liblabVersion": "2", + "deliveryMethods": ["zip"], + "languages": ["typescript"], + "specFilePath": "spec.yaml", + "docs": ["snippets"], + "auth": ["apikey"], + "languageOptions": { + "csharp": { + "packageId": "Salad.Cloud.SDK", + "authors": [ + { + "name": "salad" + }, + { + "name": "seniorquico" + } + ], + "githubRepoName": "salad-cloud-sdk-dotnet", + "homepage": "https://github.com/saladtechnologies/salad-cloud-sdk-dotnet", + "ignoreFiles": ["LICENSE"], + "liblabVersion": "2", + "sdkVersion": "0.9.0-alpha.1", + "targetBranch": "main" + }, + "go": { + "goModuleName": "github.com/saladtechnologies/salad-cloud-sdk-go", + "githubRepoName": "salad-cloud-sdk-go", + "ignoreFiles": ["LICENSE"], + "liblabVersion": "2", + "sdkVersion": "0.9.0-alpha.1", + "targetBranch": "main" + }, + "java": { + "groupId": "com.salad.cloud", + "artifactId": "sdk", + "developers": [ + { + "name": "SaladCloud Developers", + "email": "dev@salad.com", + "organization": "Salad Technologies", + "organizationUrl": "https://salad.com" + }, + { + "name": "Kyle Dodson", + "email": "kyle@salad.com", + "organization": "Salad Technologies", + "organizationUrl": "https://salad.com" + } + ], + "githubRepoName": "salad-cloud-sdk-java", + "homepage": "https://github.com/saladtechnologies/salad-cloud-sdk-java", + "ignoreFiles": ["LICENSE"], + "liblabVersion": "2", + "sdkVersion": "0.9.0-alpha.1", + "targetBranch": "main" + }, + "python": { + "alwaysInitializeOptionals": true, + "classifiers": [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Internet", + "Topic :: Software Development", + "Topic :: Software Development :: Libraries" + ], + "projectUrls": { + "Homepage": "https://github.com/saladtechnologies/salad-cloud-sdk-python", + "Documentation": "https://docs.salad.com", + "Repository": "https://github.com/SaladTechnologies/salad-cloud-sdk-python.git", + "Issues": "https://github.com/SaladTechnologies/salad-cloud-sdk-python/issues" + }, + "pypiPackageName": "salad-cloud-sdk", + "authors": [ + { + "email": "dev@salad.com", + "name": "SaladCloud Developers" + }, + { + "email": "kyle@salad.com", + "name": "Kyle Dodson" + } + ], + "githubRepoName": "salad-cloud-sdk-python", + "ignoreFiles": ["LICENSE"], + "liblabVersion": "2", + "sdkVersion": "0.9.0-alpha.1", + "targetBranch": "main" + }, + "terraform": { + "hideComputedDiff": false, + "mockAcceptance": true, + "providerGoModuleName": "github.com/saladtechnologies/terraform-provider-salad-cloud", + "providerName": "salad-cloud", + "providerSchemaConfig": { + "authTokenKey": "api_key" + }, + "providerVersion": "0.9.0-alpha.1", + "githubRepoName": "terraform-provider-salad-cloud", + "ignoreFiles": ["LICENSE"], + "liblabVersion": "2", + "targetBranch": "main" + }, + "typescript": { + "bundle": true, + "exportClassDefault": false, + "httpClient": "fetch", + "npmName": "salad-cloud-sdk", + "npmOrg": "saladtechnologies-oss", + "authors": [ + { + "email": "dev@salad.com", + "name": "SaladCloud Developers" + }, + { + "email": "kyle@salad.com", + "name": "Kyle Dodson" + } + ], + "githubRepoName": "salad-cloud-sdk-javascript", + "homepage": "https://github.com/saladtechnologies/salad-cloud-sdk-javascript", + "ignoreFiles": ["LICENSE"], + "liblabVersion": "2", + "sdkVersion": "0.9.0-alpha.1", + "targetBranch": "main" + } + }, + "publishing": { + "githubOrg": "SaladTechnologies" + }, + "validationsToIgnore": [ + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "CreateQueueProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "UpdateQueueProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "CreateQueueJobProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "CreateContainerGroupProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "ListContainerGroupsProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "DeleteContainerGroupProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "GetContainerGroupProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "UpdateContainerGroupProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "StartContainerGroupProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "StopContainerGroupProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "ReallocateContainerGroupInstanceProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "RecreateContainerGroupInstanceProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "RestartContainerGroupInstanceProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "CreateInferenceEndpointJobProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "GetInferenceEndpointJobProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "GetInferenceEndpointJobsProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "DeleteInferenceEndpointJobProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "GetWebhookSecretKeyProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "UpdateWebhookSecretKeyProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "schemas", "ListGpuClassesProblemType"] + }, + { + "code": "oas3-unused-component", + "path": ["components", "responses", "401"] + } + ], + "apiName": "SaladCloud API", + "apiVersion": "0.9.0-alpha.1", + "authentication": { + "apiKey": { + "header": "Salad-Api-Key" + } + }, + "devContainer": true, + "generateEnv": true, + "includeOptionalSnippetParameters": true, + "inferServiceNames": false, + "license": { + "type": "MIT", + "name": "MIT", + "url": "https://opensource.org/licenses/MIT", + "path": "MIT.ejs" + }, + "responseHeaders": false, + "retry": { + "enabled": true, + "maxAttempts": 3, + "retryDelay": 150, + "maxDelay": 5000, + "retryDelayJitter": 50, + "backOffFactor": 2, + "httpCodesToRetry": [408, 429, 500, 502, 503, 504], + "httpMethodsToRetry": ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"] + }, + "multiTenant": true, + "includeWatermark": false, + "language": "typescript", + "deliveryMethod": "zip", + "hooks": { + "enabled": false, + "sourceDir": "" + }, + "bundle": true, + "exportClassDefault": false, + "httpClient": "fetch", + "npmName": "salad-cloud-sdk", + "npmOrg": "saladtechnologies-oss", + "authors": [ + { + "email": "dev@salad.com", + "name": "SaladCloud Developers" + }, + { + "email": "kyle@salad.com", + "name": "Kyle Dodson" + } + ], + "githubRepoName": "salad-cloud-sdk-javascript", + "homepage": "https://github.com/saladtechnologies/salad-cloud-sdk-javascript", + "ignoreFiles": ["LICENSE"], + "targetBranch": "main", + "typescriptVersion": "5.3.3", + "zodVersion": "3.22.0", + "compilerOptions": { + "target": "es6", + "module": "Node16", + "lib": ["es2017", "dom"] + }, + "usesFormData": false, + "environmentVariables": [], + "fileOutput": "/tmp", + "httpLibrary": { + "name": "fetch", + "packages": {}, + "languages": ["typescript"], + "types": { + "packageName": "@types/isomorphic-fetch", + "version": "^0.0.36" + } + }, + "customQueries": { + "paths": [], + "rawQueries": [], + "queriesData": [] + } + }, + "files": [ + "package.json", + "tsconfig.json", + "examples/tsconfig.json", + "examples/package.json", + "examples/README.md", + "examples/src/index.ts", + "src/http/client.ts", + "src/services/container-groups/models/container-group-list.ts", + "src/services/container-groups/models/create-container-group.ts", + "src/services/common/container-group.ts", + "src/services/container-groups/models/update-container-group.ts", + "src/services/container-groups/models/container-group-instances.ts", + "src/services/container-groups/models/container-group-instance.ts", + "src/services/workload-errors/models/workload-error-list.ts", + "src/services/queues/models/queue-list.ts", + "src/services/queues/models/create-queue.ts", + "src/services/queues/models/queue.ts", + "src/services/queues/models/update-queue.ts", + "src/services/queues/models/queue-job-list.ts", + "src/services/queues/models/create-queue-job.ts", + "src/services/queues/models/queue-job.ts", + "src/services/quotas/models/quotas.ts", + "src/services/inference-endpoints/models/inference-endpoints-list.ts", + "src/services/inference-endpoints/models/inference-endpoint.ts", + "src/services/inference-endpoints/models/inference-endpoint-job-list.ts", + "src/services/inference-endpoints/models/create-inference-endpoint-job.ts", + "src/services/inference-endpoints/models/inference-endpoint-job.ts", + "src/services/organization-data/models/gpu-classes-list.ts", + "src/services/webhook-secret-key/models/webhook-secret-key.ts", + "src/services/common/container.ts", + "src/services/common/container-restart-policy.ts", + "src/services/common/container-group-state.ts", + "src/services/common/country-code.ts", + "src/services/common/container-group-networking.ts", + "src/services/common/container-group-liveness-probe.ts", + "src/services/common/container-group-readiness-probe.ts", + "src/services/common/container-group-startup-probe.ts", + "src/services/common/container-group-queue-connection.ts", + "src/services/common/container-resource-requirements.ts", + "src/services/common/container-group-priority.ts", + "src/services/common/container-logging.ts", + "src/services/common/logging-axiom-1.ts", + "src/services/common/logging-datadog-1.ts", + "src/services/common/logging-new-relic-1.ts", + "src/services/common/logging-splunk-1.ts", + "src/services/common/logging-tcp-1.ts", + "src/services/common/logging-http-1.ts", + "src/services/common/datadog-tags-1.ts", + "src/services/common/http-format-1.ts", + "src/services/common/http-headers-1.ts", + "src/services/common/http-compression-1.ts", + "src/services/common/container-group-status.ts", + "src/services/common/container-group-instance-status-count.ts", + "src/services/common/container-networking-protocol.ts", + "src/services/common/container-group-probe-tcp.ts", + "src/services/common/container-group-probe-http.ts", + "src/services/common/container-group-probe-grpc.ts", + "src/services/common/container-group-probe-exec.ts", + "src/services/common/container-probe-http-scheme.ts", + "src/services/common/container-group-probe-http-headers-2.ts", + "src/services/container-groups/models/create-container.ts", + "src/services/container-groups/models/create-container-group-networking.ts", + "src/services/container-groups/models/create-container-logging.ts", + "src/services/container-groups/models/create-container-registry-authentication.ts", + "src/services/container-groups/models/logging-axiom-2.ts", + "src/services/container-groups/models/logging-datadog-2.ts", + "src/services/container-groups/models/logging-new-relic-2.ts", + "src/services/container-groups/models/logging-splunk-2.ts", + "src/services/container-groups/models/logging-tcp-2.ts", + "src/services/container-groups/models/logging-http-2.ts", + "src/services/container-groups/models/datadog-tags-2.ts", + "src/services/container-groups/models/http-format-2.ts", + "src/services/container-groups/models/http-headers-3.ts", + "src/services/container-groups/models/http-compression-2.ts", + "src/services/container-groups/models/registry-authentication-basic-1.ts", + "src/services/container-groups/models/registry-authentication-gcp-gcr-1.ts", + "src/services/container-groups/models/registry-authentication-aws-ecr-1.ts", + "src/services/container-groups/models/registry-authentication-docker-hub-1.ts", + "src/services/container-groups/models/registry-authentication-gcp-gar-1.ts", + "src/services/container-groups/models/update-container.ts", + "src/services/container-groups/models/update-container-group-networking.ts", + "src/services/container-groups/models/resources.ts", + "src/services/container-groups/models/update-container-logging.ts", + "src/services/container-groups/models/update-container-registry-authentication.ts", + "src/services/container-groups/models/logging-axiom-3.ts", + "src/services/container-groups/models/logging-datadog-3.ts", + "src/services/container-groups/models/logging-new-relic-3.ts", + "src/services/container-groups/models/logging-splunk-3.ts", + "src/services/container-groups/models/logging-tcp-3.ts", + "src/services/container-groups/models/logging-http-3.ts", + "src/services/container-groups/models/datadog-tags-3.ts", + "src/services/container-groups/models/http-format-3.ts", + "src/services/container-groups/models/http-headers-4.ts", + "src/services/container-groups/models/http-compression-3.ts", + "src/services/container-groups/models/registry-authentication-basic-2.ts", + "src/services/container-groups/models/registry-authentication-gcp-gcr-2.ts", + "src/services/container-groups/models/registry-authentication-aws-ecr-2.ts", + "src/services/container-groups/models/registry-authentication-docker-hub-2.ts", + "src/services/container-groups/models/registry-authentication-gcp-gar-2.ts", + "src/services/container-groups/models/state.ts", + "src/services/workload-errors/models/workload-error.ts", + "src/services/queues/models/queue-job-status.ts", + "src/services/queues/models/queue-job-event.ts", + "src/services/queues/models/queue-job-event-action.ts", + "src/services/quotas/models/container-groups-quotas.ts", + "src/services/quotas/models/recipes-quotas.ts", + "src/services/inference-endpoints/models/inference-endpoint-job-status.ts", + "src/services/inference-endpoints/models/inference-endpoint-job-event.ts", + "src/services/inference-endpoints/models/inference-endpoint-job-event-action.ts", + "src/services/organization-data/models/gpu-class.ts", + "src/services/organization-data/models/gpu-class-price.ts", + ".gitignore", + "src/services/base-service.ts", + "src/services/container-groups/container-groups.ts", + "src/services/workload-errors/workload-errors.ts", + "src/services/queues/queues.ts", + "src/services/quotas/quotas.ts", + "src/services/inference-endpoints/inference-endpoints.ts", + "src/services/organization-data/organization-data.ts", + "src/services/webhook-secret-key/webhook-secret-key.ts", + "src/index.ts", + "src/services/container-groups/models/index.ts", + "src/services/common/index.ts", + "src/services/workload-errors/models/index.ts", + "src/services/queues/models/index.ts", + "src/services/quotas/models/index.ts", + "src/services/inference-endpoints/models/index.ts", + "src/services/organization-data/models/index.ts", + "src/services/webhook-secret-key/models/index.ts", + "src/services/container-groups/index.ts", + "src/services/workload-errors/index.ts", + "src/services/queues/index.ts", + "src/services/quotas/index.ts", + "src/services/inference-endpoints/index.ts", + "src/services/organization-data/index.ts", + "src/services/webhook-secret-key/index.ts", + "src/http/index.ts", + "src/http/handlers/handler-chain.ts", + "src/http/types.ts", + "src/http/error.ts", + "src/http/handlers/terminating-handler.ts", + "src/http/handlers/hook-handler.ts", + "src/http/hooks/custom-hook.ts", + "src/http/hooks/hook.ts", + "src/http/handlers/retry-handler.ts", + "src/http/environment.ts", + "src/http/handlers/response-validation-handler.ts", + "src/http/handlers/auth-handler.ts", + "./LICENSE", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-get.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-post.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-get.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-patch.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-delete.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-start-post.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-stop-post.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-get.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-get.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-reallocate-post.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-recreate-post.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-restart-post.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-errors-get.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-get.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-post.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-get.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-patch.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-delete.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-get.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-post.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-get.md", + "documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-delete.md", + "documentation/snippets/organizations-{organization_name}-quotas-get.md", + "documentation/snippets/organizations-{organization_name}-inference-endpoints-get.md", + "documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-get.md", + "documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-get.md", + "documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-post.md", + "documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-get.md", + "documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-delete.md", + "documentation/snippets/organizations-{organization_name}-gpu-classes-get.md", + "documentation/snippets/organizations-{organization_name}-webhook-secret-key-get.md", + "documentation/snippets/organizations-{organization_name}-webhook-secret-key-post.md", + "src/services/queues/request-params.ts", + "src/services/inference-endpoints/request-params.ts", + "documentation/models/ContainerGroupList.md", + "documentation/models/CreateContainerGroup.md", + "documentation/models/ContainerGroup.md", + "documentation/models/UpdateContainerGroup.md", + "documentation/models/ContainerGroupInstances.md", + "documentation/models/WorkloadErrorList.md", + "documentation/models/QueueList.md", + "documentation/models/CreateQueue.md", + "documentation/models/Queue.md", + "documentation/models/UpdateQueue.md", + "documentation/models/QueueJobList.md", + "documentation/models/CreateQueueJob.md", + "documentation/models/Quotas.md", + "documentation/models/InferenceEndpointsList.md", + "documentation/models/InferenceEndpoint.md", + "documentation/models/InferenceEndpointJobList.md", + "documentation/models/CreateInferenceEndpointJob.md", + "documentation/models/GpuClassesList.md", + "documentation/models/WebhookSecretKey.md", + "documentation/models/ContainerRestartPolicy.md", + "documentation/models/ContainerGroupState.md", + "documentation/models/CountryCode.md", + "documentation/models/ContainerGroupNetworking.md", + "documentation/models/ContainerGroupLivenessProbe.md", + "documentation/models/ContainerGroupReadinessProbe.md", + "documentation/models/ContainerGroupStartupProbe.md", + "documentation/models/ContainerGroupQueueConnection.md", + "documentation/models/ContainerResourceRequirements.md", + "documentation/models/ContainerGroupPriority.md", + "documentation/models/ContainerGroupStatus.md", + "documentation/models/ContainerGroupInstanceStatusCount.md", + "documentation/models/ContainerNetworkingProtocol.md", + "documentation/models/ContainerGroupProbeTcp.md", + "documentation/models/ContainerGroupProbeHttp.md", + "documentation/models/ContainerGroupProbeGrpc.md", + "documentation/models/ContainerGroupProbeExec.md", + "documentation/models/ContainerProbeHttpScheme.md", + "documentation/models/ContainerGroupProbeHttpHeaders2.md", + "documentation/models/CreateContainerGroupNetworking.md", + "documentation/models/UpdateContainerGroupNetworking.md", + "documentation/models/WorkloadError.md", + "documentation/models/ContainerGroupsQuotas.md", + "documentation/models/RecipesQuotas.md", + "documentation/models/GpuClass.md", + "documentation/models/GpuClassPrice.md", + "src/http/handlers/request-validation-handler.ts", + ".devcontainer/devcontainer.json", + "src/http/transport/request.ts", + "src/http/transport/request-builder.ts", + "src/http/serialization/base-serializer.ts", + "src/http/serialization/query-serializer.ts", + "src/http/serialization/path-serializer.ts", + "src/http/serialization/header-serializer.ts", + "src/http/transport/request-fetch-adapter.ts", + "src/http/transport/transport-hook-adapter.ts", + "documentation/models/ContainerGroupInstance.md", + "documentation/models/QueueJob.md", + "documentation/models/InferenceEndpointJob.md", + "documentation/models/QueueJobEvent.md", + "documentation/models/InferenceEndpointJobEvent.md", + "documentation/services/WorkloadErrorsService.md", + "documentation/services/QuotasService.md", + "documentation/services/OrganizationDataService.md", + "documentation/services/WebhookSecretKeyService.md", + "documentation/services/InferenceEndpointsService.md", + "documentation/services/QueuesService.md", + "README.md", + "documentation/models/Container.md", + "documentation/services/ContainerGroupsService.md", + "documentation/models/CreateContainer.md", + "documentation/models/UpdateContainer.md" + ] +} diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..2edeafb --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20 \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a1611d5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Salad Technologies, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index b2a4248..41df46d 100644 --- a/README.md +++ b/README.md @@ -1 +1,176 @@ -# SaladCloud SDK for .NET +# SaladCloudSdk TypeScript SDK 0.9.0-alpha.1 + +Welcome to the SaladCloudSdk SDK documentation. This guide will help you get started with integrating and using the SaladCloudSdk SDK in your project. + +## Versions + +- API version: `0.9.0-alpha.1` +- SDK version: `0.9.0-alpha.1` + +## About the API + +The SaladCloud REST API. Please refer to the [SaladCloud API Documentation](https://docs.salad.com/api-reference) for more details. + +## Table of Contents + +- [Setup & Configuration](#setup--configuration) + - [Supported Language Versions](#supported-language-versions) + - [Installation](#installation) +- [Authentication](#authentication) + - [API Key Authentication](#api-key-authentication) +- [Setting a Custom Timeout](#setting-a-custom-timeout) +- [Sample Usage](#sample-usage) +- [Services](#services) +- [Models](#models) +- [License](#license) + +# Setup & Configuration + +## Supported Language Versions + +This SDK is compatible with the following versions: `TypeScript >= 4.8.4` + +## Installation + +To get started with the SDK, we recommend installing using `npm`: + +```bash +npm install @saladtechnologies-oss/salad-cloud-sdk +``` + +## Authentication + +### API Key Authentication + +The SaladCloudSdk API uses API keys as a form of authentication. An API key is a unique identifier used to authenticate a user, developer, or a program that is calling the API. + +#### Setting the API key + +When you initialize the SDK, you can set the API key as follows: + +```ts +const sdk = new SaladCloudSdk({ apiKey: 'YOUR_API_KEY' }); +``` + +If you need to set or update the API key after initializing the SDK, you can use: + +```ts +const sdk = new SaladCloudSdk(); +sdk.apiKey = 'YOUR_API_KEY'; +``` + +## Setting a Custom Timeout + +You can set a custom timeout for the SDK's HTTP requests as follows: + +```ts +const saladCloudSdk = new SaladCloudSdk({ timeout: 10000 }); +``` + +# Sample Usage + +Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint: + +```ts +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.quotas.getQuotas('y-7yhh5v70xusg163gdfs9vma6wkyd2rcvosdiwny-k'); + + console.log(data); +})(); +``` + +## Services + +The SDK provides various services to interact with the API. + +
+Below is a list of all available services with links to their detailed documentation: + +| Name | +| :------------------------------------------------------------------------------- | +| [ContainerGroupsService](documentation/services/ContainerGroupsService.md) | +| [WorkloadErrorsService](documentation/services/WorkloadErrorsService.md) | +| [QueuesService](documentation/services/QueuesService.md) | +| [QuotasService](documentation/services/QuotasService.md) | +| [InferenceEndpointsService](documentation/services/InferenceEndpointsService.md) | +| [OrganizationDataService](documentation/services/OrganizationDataService.md) | +| [WebhookSecretKeyService](documentation/services/WebhookSecretKeyService.md) | + +
+ +## Models + +The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently. + +
+Below is a list of all available models with links to their detailed documentation: + +| Name | Description | +| :--------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------- | +| [ContainerGroupList](documentation/models/ContainerGroupList.md) | Represents a list of container groups | +| [CreateContainerGroup](documentation/models/CreateContainerGroup.md) | Represents a request to create a container group | +| [ContainerGroup](documentation/models/ContainerGroup.md) | Represents a container group | +| [UpdateContainerGroup](documentation/models/UpdateContainerGroup.md) | Represents a request to update a container group | +| [ContainerGroupInstances](documentation/models/ContainerGroupInstances.md) | Represents a list of container group instances | +| [ContainerGroupInstance](documentation/models/ContainerGroupInstance.md) | Represents the details of a single container group instance | +| [WorkloadErrorList](documentation/models/WorkloadErrorList.md) | Represents a list of workload errors | +| [QueueList](documentation/models/QueueList.md) | Represents a list of queues | +| [CreateQueue](documentation/models/CreateQueue.md) | Represents a request to create a queue | +| [Queue](documentation/models/Queue.md) | Represents a queue | +| [UpdateQueue](documentation/models/UpdateQueue.md) | Represents a request to update a queue | +| [QueueJobList](documentation/models/QueueJobList.md) | Represents a list of queue jobs | +| [CreateQueueJob](documentation/models/CreateQueueJob.md) | Represents a request to create a queue job | +| [QueueJob](documentation/models/QueueJob.md) | Represents a queue job | +| [Quotas](documentation/models/Quotas.md) | Represents the organization quotas | +| [InferenceEndpointsList](documentation/models/InferenceEndpointsList.md) | Represents a list of inference endpoints | +| [InferenceEndpoint](documentation/models/InferenceEndpoint.md) | Represents an inference endpoint | +| [InferenceEndpointJobList](documentation/models/InferenceEndpointJobList.md) | Represents a list of inference endpoint jobs | +| [CreateInferenceEndpointJob](documentation/models/CreateInferenceEndpointJob.md) | Represents a request to create a inference endpoint job | +| [InferenceEndpointJob](documentation/models/InferenceEndpointJob.md) | Represents a inference endpoint job | +| [GpuClassesList](documentation/models/GpuClassesList.md) | Represents a list of GPU classes | +| [WebhookSecretKey](documentation/models/WebhookSecretKey.md) | Represents a webhook secret key | +| [Container](documentation/models/Container.md) | Represents a container | +| [ContainerRestartPolicy](documentation/models/ContainerRestartPolicy.md) | | +| [ContainerGroupState](documentation/models/ContainerGroupState.md) | Represents a container group state | +| [CountryCode](documentation/models/CountryCode.md) | | +| [ContainerGroupNetworking](documentation/models/ContainerGroupNetworking.md) | Represents container group networking parameters | +| [ContainerGroupLivenessProbe](documentation/models/ContainerGroupLivenessProbe.md) | Represents the container group liveness probe | +| [ContainerGroupReadinessProbe](documentation/models/ContainerGroupReadinessProbe.md) | Represents the container group readiness probe | +| [ContainerGroupStartupProbe](documentation/models/ContainerGroupStartupProbe.md) | Represents the container group startup probe | +| [ContainerGroupQueueConnection](documentation/models/ContainerGroupQueueConnection.md) | Represents container group queue connection | +| [ContainerResourceRequirements](documentation/models/ContainerResourceRequirements.md) | Represents a container resource requirements | +| [ContainerGroupPriority](documentation/models/ContainerGroupPriority.md) | | +| [ContainerGroupStatus](documentation/models/ContainerGroupStatus.md) | | +| [ContainerGroupInstanceStatusCount](documentation/models/ContainerGroupInstanceStatusCount.md) | Represents a container group instance status count | +| [ContainerNetworkingProtocol](documentation/models/ContainerNetworkingProtocol.md) | | +| [ContainerGroupProbeTcp](documentation/models/ContainerGroupProbeTcp.md) | | +| [ContainerGroupProbeHttp](documentation/models/ContainerGroupProbeHttp.md) | | +| [ContainerGroupProbeGrpc](documentation/models/ContainerGroupProbeGrpc.md) | | +| [ContainerGroupProbeExec](documentation/models/ContainerGroupProbeExec.md) | | +| [ContainerProbeHttpScheme](documentation/models/ContainerProbeHttpScheme.md) | | +| [ContainerGroupProbeHttpHeaders2](documentation/models/ContainerGroupProbeHttpHeaders2.md) | | +| [CreateContainer](documentation/models/CreateContainer.md) | Represents a container | +| [CreateContainerGroupNetworking](documentation/models/CreateContainerGroupNetworking.md) | Represents container group networking parameters | +| [UpdateContainer](documentation/models/UpdateContainer.md) | Represents an update container object | +| [UpdateContainerGroupNetworking](documentation/models/UpdateContainerGroupNetworking.md) | Represents update container group networking parameters | +| [WorkloadError](documentation/models/WorkloadError.md) | Represents a workload error | +| [QueueJobEvent](documentation/models/QueueJobEvent.md) | Represents an event for queue job | +| [ContainerGroupsQuotas](documentation/models/ContainerGroupsQuotas.md) | | +| [RecipesQuotas](documentation/models/RecipesQuotas.md) | | +| [InferenceEndpointJobEvent](documentation/models/InferenceEndpointJobEvent.md) | Represents an event for inference endpoint job | +| [GpuClass](documentation/models/GpuClass.md) | Represents a GPU Class | +| [GpuClassPrice](documentation/models/GpuClassPrice.md) | Represents the price of a GPU class for a given container group priority | + +
+ +## License + +This SDK is licensed under the MIT License. + +See the [LICENSE](LICENSE) file for more details. diff --git a/documentation/models/Container.md b/documentation/models/Container.md new file mode 100644 index 0000000..ef9ca45 --- /dev/null +++ b/documentation/models/Container.md @@ -0,0 +1,127 @@ +# Container + +Represents a container + +**Properties** + +| Name | Type | Required | Description | +| :------------------- | :---------------------------- | :------- | :------------------------------------------- | +| image | string | ✅ | | +| resources | ContainerResourceRequirements | ✅ | Represents a container resource requirements | +| command | string[] | ✅ | | +| priority | ContainerGroupPriority | ❌ | | +| size | number | ❌ | | +| hash | string | ❌ | | +| environmentVariables | any | ❌ | | +| logging | ContainerLogging | ❌ | | + +# ContainerLogging + +**Properties** + +| Name | Type | Required | Description | +| :------- | :--------------- | :------- | :---------- | +| axiom | LoggingAxiom1 | ❌ | | +| datadog | LoggingDatadog1 | ❌ | | +| newRelic | LoggingNewRelic1 | ❌ | | +| splunk | LoggingSplunk1 | ❌ | | +| tcp | LoggingTcp1 | ❌ | | +| http | LoggingHttp1 | ❌ | | + +# LoggingAxiom1 + +**Properties** + +| Name | Type | Required | Description | +| :------- | :----- | :------- | :---------- | +| host | string | ✅ | | +| apiToken | string | ✅ | | +| dataset | string | ✅ | | + +# LoggingDatadog1 + +**Properties** + +| Name | Type | Required | Description | +| :----- | :------------- | :------- | :---------- | +| host | string | ✅ | | +| apiKey | string | ✅ | | +| tags | DatadogTags1[] | ❌ | | + +# DatadogTags1 + +**Properties** + +| Name | Type | Required | Description | +| :---- | :----- | :------- | :---------- | +| name | string | ✅ | | +| value | string | ✅ | | + +# LoggingNewRelic1 + +**Properties** + +| Name | Type | Required | Description | +| :----------- | :----- | :------- | :---------- | +| host | string | ✅ | | +| ingestionKey | string | ✅ | | + +# LoggingSplunk1 + +**Properties** + +| Name | Type | Required | Description | +| :---- | :----- | :------- | :---------- | +| host | string | ✅ | | +| token | string | ✅ | | + +# LoggingTcp1 + +**Properties** + +| Name | Type | Required | Description | +| :--- | :----- | :------- | :---------- | +| host | string | ✅ | | +| port | number | ✅ | | + +# LoggingHttp1 + +**Properties** + +| Name | Type | Required | Description | +| :---------- | :--------------- | :------- | :---------- | +| host | string | ✅ | | +| port | number | ✅ | | +| format | HttpFormat1 | ✅ | | +| compression | HttpCompression1 | ✅ | | +| user | string | ❌ | | +| password | string | ❌ | | +| path | string | ❌ | | +| headers | HttpHeaders1[] | ❌ | | + +# HttpFormat1 + +**Properties** + +| Name | Type | Required | Description | +| :-------- | :----- | :------- | :----------- | +| JSON | string | ✅ | "json" | +| JSONLINES | string | ✅ | "json_lines" | + +# HttpCompression1 + +**Properties** + +| Name | Type | Required | Description | +| :--- | :----- | :------- | :---------- | +| NONE | string | ✅ | "none" | +| GZIP | string | ✅ | "gzip" | + +# HttpHeaders1 + +**Properties** + +| Name | Type | Required | Description | +| :---- | :----- | :------- | :---------- | +| name | string | ✅ | | +| value | string | ✅ | | diff --git a/documentation/models/ContainerGroup.md b/documentation/models/ContainerGroup.md new file mode 100644 index 0000000..92fc36f --- /dev/null +++ b/documentation/models/ContainerGroup.md @@ -0,0 +1,26 @@ +# ContainerGroup + +Represents a container group + +**Properties** + +| Name | Type | Required | Description | +| :-------------- | :---------------------------- | :------- | :---------------------------------------------------------------------------------------------- | +| id | string | ✅ | | +| name | string | ✅ | | +| displayName | string | ✅ | | +| container | Container | ✅ | Represents a container | +| autostartPolicy | boolean | ✅ | | +| restartPolicy | ContainerRestartPolicy | ✅ | | +| replicas | number | ✅ | | +| currentState | ContainerGroupState | ✅ | Represents a container group state | +| createTime | string | ✅ | | +| updateTime | string | ✅ | | +| pendingChange | boolean | ✅ | | +| version | number | ✅ | | +| countryCodes | CountryCode[] | ❌ | List of countries nodes must be located in. Remove this field to permit nodes from any country. | +| networking | ContainerGroupNetworking | ❌ | Represents container group networking parameters | +| livenessProbe | ContainerGroupLivenessProbe | ❌ | Represents the container group liveness probe | +| readinessProbe | ContainerGroupReadinessProbe | ❌ | Represents the container group readiness probe | +| startupProbe | ContainerGroupStartupProbe | ❌ | Represents the container group startup probe | +| queueConnection | ContainerGroupQueueConnection | ❌ | Represents container group queue connection | diff --git a/documentation/models/ContainerGroupInstance.md b/documentation/models/ContainerGroupInstance.md new file mode 100644 index 0000000..fafd3e9 --- /dev/null +++ b/documentation/models/ContainerGroupInstance.md @@ -0,0 +1,29 @@ +# ContainerGroupInstance + +Represents the details of a single container group instance + +**Properties** + +| Name | Type | Required | Description | +| :--------- | :------ | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------- | +| instanceId | string | ✅ | The unique instance ID | +| machineId | string | ✅ | The machine ID | +| state | State | ✅ | The state of the container group instance | +| updateTime | string | ✅ | The UTC date & time when the workload on this machine transitioned to the current state | +| version | number | ✅ | The version of the running container group | +| ready | boolean | ❌ | Specifies whether the container group instance is currently passing its readiness check. If no readiness probe is defined, is true once fully started. | +| started | boolean | ❌ | Specifies whether the container group instance passed its startup probe. Is always true when no startup probe is defined. | + +# State + +The state of the container group instance + +**Properties** + +| Name | Type | Required | Description | +| :---------- | :----- | :------- | :------------ | +| ALLOCATING | string | ✅ | "allocating" | +| DOWNLOADING | string | ✅ | "downloading" | +| CREATING | string | ✅ | "creating" | +| RUNNING | string | ✅ | "running" | +| STOPPING | string | ✅ | "stopping" | diff --git a/documentation/models/ContainerGroupInstanceStatusCount.md b/documentation/models/ContainerGroupInstanceStatusCount.md new file mode 100644 index 0000000..b8f00c9 --- /dev/null +++ b/documentation/models/ContainerGroupInstanceStatusCount.md @@ -0,0 +1,12 @@ +# ContainerGroupInstanceStatusCount + +Represents a container group instance status count + +**Properties** + +| Name | Type | Required | Description | +| :-------------- | :----- | :------- | :---------- | +| allocatingCount | number | ✅ | | +| creatingCount | number | ✅ | | +| runningCount | number | ✅ | | +| stoppingCount | number | ✅ | | diff --git a/documentation/models/ContainerGroupInstances.md b/documentation/models/ContainerGroupInstances.md new file mode 100644 index 0000000..abd0293 --- /dev/null +++ b/documentation/models/ContainerGroupInstances.md @@ -0,0 +1,9 @@ +# ContainerGroupInstances + +Represents a list of container group instances + +**Properties** + +| Name | Type | Required | Description | +| :-------- | :----------------------- | :------- | :---------- | +| instances | ContainerGroupInstance[] | ✅ | | diff --git a/documentation/models/ContainerGroupList.md b/documentation/models/ContainerGroupList.md new file mode 100644 index 0000000..c9ebe4a --- /dev/null +++ b/documentation/models/ContainerGroupList.md @@ -0,0 +1,9 @@ +# ContainerGroupList + +Represents a list of container groups + +**Properties** + +| Name | Type | Required | Description | +| :---- | :--------------- | :------- | :---------- | +| items | ContainerGroup[] | ✅ | | diff --git a/documentation/models/ContainerGroupLivenessProbe.md b/documentation/models/ContainerGroupLivenessProbe.md new file mode 100644 index 0000000..88b9d30 --- /dev/null +++ b/documentation/models/ContainerGroupLivenessProbe.md @@ -0,0 +1,17 @@ +# ContainerGroupLivenessProbe + +Represents the container group liveness probe + +**Properties** + +| Name | Type | Required | Description | +| :------------------ | :---------------------- | :------- | :---------- | +| initialDelaySeconds | number | ✅ | | +| periodSeconds | number | ✅ | | +| timeoutSeconds | number | ✅ | | +| successThreshold | number | ✅ | | +| failureThreshold | number | ✅ | | +| tcp | ContainerGroupProbeTcp | ❌ | | +| http | ContainerGroupProbeHttp | ❌ | | +| grpc | ContainerGroupProbeGrpc | ❌ | | +| exec | ContainerGroupProbeExec | ❌ | | diff --git a/documentation/models/ContainerGroupNetworking.md b/documentation/models/ContainerGroupNetworking.md new file mode 100644 index 0000000..e4edd7d --- /dev/null +++ b/documentation/models/ContainerGroupNetworking.md @@ -0,0 +1,12 @@ +# ContainerGroupNetworking + +Represents container group networking parameters + +**Properties** + +| Name | Type | Required | Description | +| :------- | :-------------------------- | :------- | :---------- | +| protocol | ContainerNetworkingProtocol | ✅ | | +| port | number | ✅ | | +| auth | boolean | ✅ | | +| dns | string | ✅ | | diff --git a/documentation/models/ContainerGroupPriority.md b/documentation/models/ContainerGroupPriority.md new file mode 100644 index 0000000..76c8753 --- /dev/null +++ b/documentation/models/ContainerGroupPriority.md @@ -0,0 +1,10 @@ +# ContainerGroupPriority + +**Properties** + +| Name | Type | Required | Description | +| :----- | :----- | :------- | :---------- | +| HIGH | string | ✅ | "high" | +| MEDIUM | string | ✅ | "medium" | +| LOW | string | ✅ | "low" | +| BATCH | string | ✅ | "batch" | diff --git a/documentation/models/ContainerGroupProbeExec.md b/documentation/models/ContainerGroupProbeExec.md new file mode 100644 index 0000000..c249b5e --- /dev/null +++ b/documentation/models/ContainerGroupProbeExec.md @@ -0,0 +1,7 @@ +# ContainerGroupProbeExec + +**Properties** + +| Name | Type | Required | Description | +| :------ | :------- | :------- | :---------- | +| command | string[] | ✅ | | diff --git a/documentation/models/ContainerGroupProbeGrpc.md b/documentation/models/ContainerGroupProbeGrpc.md new file mode 100644 index 0000000..adc9c52 --- /dev/null +++ b/documentation/models/ContainerGroupProbeGrpc.md @@ -0,0 +1,8 @@ +# ContainerGroupProbeGrpc + +**Properties** + +| Name | Type | Required | Description | +| :------ | :----- | :------- | :---------- | +| service | string | ✅ | | +| port | number | ✅ | | diff --git a/documentation/models/ContainerGroupProbeHttp.md b/documentation/models/ContainerGroupProbeHttp.md new file mode 100644 index 0000000..aebb7e7 --- /dev/null +++ b/documentation/models/ContainerGroupProbeHttp.md @@ -0,0 +1,10 @@ +# ContainerGroupProbeHttp + +**Properties** + +| Name | Type | Required | Description | +| :------ | :-------------------------------- | :------- | :---------- | +| path | string | ✅ | | +| port | number | ✅ | | +| scheme | ContainerProbeHttpScheme | ❌ | | +| headers | ContainerGroupProbeHttpHeaders2[] | ❌ | | diff --git a/documentation/models/ContainerGroupProbeHttpHeaders2.md b/documentation/models/ContainerGroupProbeHttpHeaders2.md new file mode 100644 index 0000000..5637f42 --- /dev/null +++ b/documentation/models/ContainerGroupProbeHttpHeaders2.md @@ -0,0 +1,8 @@ +# ContainerGroupProbeHttpHeaders2 + +**Properties** + +| Name | Type | Required | Description | +| :---- | :----- | :------- | :---------- | +| name | string | ✅ | | +| value | string | ✅ | | diff --git a/documentation/models/ContainerGroupProbeTcp.md b/documentation/models/ContainerGroupProbeTcp.md new file mode 100644 index 0000000..af946e7 --- /dev/null +++ b/documentation/models/ContainerGroupProbeTcp.md @@ -0,0 +1,7 @@ +# ContainerGroupProbeTcp + +**Properties** + +| Name | Type | Required | Description | +| :--- | :----- | :------- | :---------- | +| port | number | ✅ | | diff --git a/documentation/models/ContainerGroupQueueConnection.md b/documentation/models/ContainerGroupQueueConnection.md new file mode 100644 index 0000000..c86bfbc --- /dev/null +++ b/documentation/models/ContainerGroupQueueConnection.md @@ -0,0 +1,11 @@ +# ContainerGroupQueueConnection + +Represents container group queue connection + +**Properties** + +| Name | Type | Required | Description | +| :-------- | :----- | :------- | :---------- | +| path | string | ✅ | | +| port | number | ✅ | | +| queueName | string | ✅ | | diff --git a/documentation/models/ContainerGroupReadinessProbe.md b/documentation/models/ContainerGroupReadinessProbe.md new file mode 100644 index 0000000..115415d --- /dev/null +++ b/documentation/models/ContainerGroupReadinessProbe.md @@ -0,0 +1,17 @@ +# ContainerGroupReadinessProbe + +Represents the container group readiness probe + +**Properties** + +| Name | Type | Required | Description | +| :------------------ | :---------------------- | :------- | :---------- | +| initialDelaySeconds | number | ✅ | | +| periodSeconds | number | ✅ | | +| timeoutSeconds | number | ✅ | | +| successThreshold | number | ✅ | | +| failureThreshold | number | ✅ | | +| tcp | ContainerGroupProbeTcp | ❌ | | +| http | ContainerGroupProbeHttp | ❌ | | +| grpc | ContainerGroupProbeGrpc | ❌ | | +| exec | ContainerGroupProbeExec | ❌ | | diff --git a/documentation/models/ContainerGroupStartupProbe.md b/documentation/models/ContainerGroupStartupProbe.md new file mode 100644 index 0000000..7706dbc --- /dev/null +++ b/documentation/models/ContainerGroupStartupProbe.md @@ -0,0 +1,17 @@ +# ContainerGroupStartupProbe + +Represents the container group startup probe + +**Properties** + +| Name | Type | Required | Description | +| :------------------ | :---------------------- | :------- | :---------- | +| initialDelaySeconds | number | ✅ | | +| periodSeconds | number | ✅ | | +| timeoutSeconds | number | ✅ | | +| successThreshold | number | ✅ | | +| failureThreshold | number | ✅ | | +| tcp | ContainerGroupProbeTcp | ❌ | | +| http | ContainerGroupProbeHttp | ❌ | | +| grpc | ContainerGroupProbeGrpc | ❌ | | +| exec | ContainerGroupProbeExec | ❌ | | diff --git a/documentation/models/ContainerGroupState.md b/documentation/models/ContainerGroupState.md new file mode 100644 index 0000000..2c7bdb2 --- /dev/null +++ b/documentation/models/ContainerGroupState.md @@ -0,0 +1,13 @@ +# ContainerGroupState + +Represents a container group state + +**Properties** + +| Name | Type | Required | Description | +| :------------------- | :-------------------------------- | :------- | :------------------------------------------------- | +| status | ContainerGroupStatus | ✅ | | +| startTime | string | ✅ | | +| finishTime | string | ✅ | | +| instanceStatusCounts | ContainerGroupInstanceStatusCount | ✅ | Represents a container group instance status count | +| description | string | ❌ | | diff --git a/documentation/models/ContainerGroupStatus.md b/documentation/models/ContainerGroupStatus.md new file mode 100644 index 0000000..951323d --- /dev/null +++ b/documentation/models/ContainerGroupStatus.md @@ -0,0 +1,12 @@ +# ContainerGroupStatus + +**Properties** + +| Name | Type | Required | Description | +| :-------- | :----- | :------- | :---------- | +| PENDING | string | ✅ | "pending" | +| RUNNING | string | ✅ | "running" | +| STOPPED | string | ✅ | "stopped" | +| SUCCEEDED | string | ✅ | "succeeded" | +| FAILED | string | ✅ | "failed" | +| DEPLOYING | string | ✅ | "deploying" | diff --git a/documentation/models/ContainerGroupsQuotas.md b/documentation/models/ContainerGroupsQuotas.md new file mode 100644 index 0000000..4fe27d9 --- /dev/null +++ b/documentation/models/ContainerGroupsQuotas.md @@ -0,0 +1,11 @@ +# ContainerGroupsQuotas + +**Properties** + +| Name | Type | Required | Description | +| :-------------------------------------- | :----- | :------- | :---------- | +| maxCreatedContainerGroups | number | ✅ | | +| containerInstanceQuota | number | ✅ | | +| maxContainerGroupReallocationsPerMinute | number | ❌ | | +| maxContainerGroupRecreatesPerMinute | number | ❌ | | +| maxContainerGroupRestartsPerMinute | number | ❌ | | diff --git a/documentation/models/ContainerNetworkingProtocol.md b/documentation/models/ContainerNetworkingProtocol.md new file mode 100644 index 0000000..a8a9f17 --- /dev/null +++ b/documentation/models/ContainerNetworkingProtocol.md @@ -0,0 +1,7 @@ +# ContainerNetworkingProtocol + +**Properties** + +| Name | Type | Required | Description | +| :--- | :----- | :------- | :---------- | +| HTTP | string | ✅ | "http" | diff --git a/documentation/models/ContainerProbeHttpScheme.md b/documentation/models/ContainerProbeHttpScheme.md new file mode 100644 index 0000000..0aef268 --- /dev/null +++ b/documentation/models/ContainerProbeHttpScheme.md @@ -0,0 +1,7 @@ +# ContainerProbeHttpScheme + +**Properties** + +| Name | Type | Required | Description | +| :--- | :----- | :------- | :---------- | +| HTTP | string | ✅ | "http" | diff --git a/documentation/models/ContainerResourceRequirements.md b/documentation/models/ContainerResourceRequirements.md new file mode 100644 index 0000000..06341b1 --- /dev/null +++ b/documentation/models/ContainerResourceRequirements.md @@ -0,0 +1,12 @@ +# ContainerResourceRequirements + +Represents a container resource requirements + +**Properties** + +| Name | Type | Required | Description | +| :------------ | :------- | :------- | :---------- | +| cpu | number | ✅ | | +| memory | number | ✅ | | +| gpuClasses | string[] | ❌ | | +| storageAmount | number | ❌ | | diff --git a/documentation/models/ContainerRestartPolicy.md b/documentation/models/ContainerRestartPolicy.md new file mode 100644 index 0000000..62ff6d3 --- /dev/null +++ b/documentation/models/ContainerRestartPolicy.md @@ -0,0 +1,9 @@ +# ContainerRestartPolicy + +**Properties** + +| Name | Type | Required | Description | +| :-------- | :----- | :------- | :----------- | +| ALWAYS | string | ✅ | "always" | +| ONFAILURE | string | ✅ | "on_failure" | +| NEVER | string | ✅ | "never" | diff --git a/documentation/models/CountryCode.md b/documentation/models/CountryCode.md new file mode 100644 index 0000000..77635e4 --- /dev/null +++ b/documentation/models/CountryCode.md @@ -0,0 +1,255 @@ +# CountryCode + +**Properties** + +| Name | Type | Required | Description | +| :--- | :----- | :------- | :---------- | +| AF | string | ✅ | "af" | +| AL | string | ✅ | "al" | +| DZ | string | ✅ | "dz" | +| AS\_ | string | ✅ | "as" | +| AD | string | ✅ | "ad" | +| AO | string | ✅ | "ao" | +| AI | string | ✅ | "ai" | +| AQ | string | ✅ | "aq" | +| AG | string | ✅ | "ag" | +| AR | string | ✅ | "ar" | +| AM | string | ✅ | "am" | +| AW | string | ✅ | "aw" | +| AU | string | ✅ | "au" | +| AT | string | ✅ | "at" | +| AZ | string | ✅ | "az" | +| BS | string | ✅ | "bs" | +| BH | string | ✅ | "bh" | +| BD | string | ✅ | "bd" | +| BB | string | ✅ | "bb" | +| BY | string | ✅ | "by" | +| BE | string | ✅ | "be" | +| BZ | string | ✅ | "bz" | +| BJ | string | ✅ | "bj" | +| BM | string | ✅ | "bm" | +| BT | string | ✅ | "bt" | +| BO | string | ✅ | "bo" | +| BQ | string | ✅ | "bq" | +| BA | string | ✅ | "ba" | +| BW | string | ✅ | "bw" | +| BV | string | ✅ | "bv" | +| BR | string | ✅ | "br" | +| IO | string | ✅ | "io" | +| BN | string | ✅ | "bn" | +| BG | string | ✅ | "bg" | +| BF | string | ✅ | "bf" | +| BI | string | ✅ | "bi" | +| CV | string | ✅ | "cv" | +| KH | string | ✅ | "kh" | +| CM | string | ✅ | "cm" | +| CA | string | ✅ | "ca" | +| KY | string | ✅ | "ky" | +| CF | string | ✅ | "cf" | +| TD | string | ✅ | "td" | +| CL | string | ✅ | "cl" | +| CN | string | ✅ | "cn" | +| CX | string | ✅ | "cx" | +| CC | string | ✅ | "cc" | +| CO | string | ✅ | "co" | +| KM | string | ✅ | "km" | +| CD | string | ✅ | "cd" | +| CG | string | ✅ | "cg" | +| CK | string | ✅ | "ck" | +| CR | string | ✅ | "cr" | +| HR | string | ✅ | "hr" | +| CU | string | ✅ | "cu" | +| CW | string | ✅ | "cw" | +| CY | string | ✅ | "cy" | +| CZ | string | ✅ | "cz" | +| CI | string | ✅ | "ci" | +| DK | string | ✅ | "dk" | +| DJ | string | ✅ | "dj" | +| DM | string | ✅ | "dm" | +| DO\_ | string | ✅ | "do" | +| EC | string | ✅ | "ec" | +| EG | string | ✅ | "eg" | +| SV | string | ✅ | "sv" | +| GQ | string | ✅ | "gq" | +| ER | string | ✅ | "er" | +| EE | string | ✅ | "ee" | +| SZ | string | ✅ | "sz" | +| ET | string | ✅ | "et" | +| FK | string | ✅ | "fk" | +| FO | string | ✅ | "fo" | +| FJ | string | ✅ | "fj" | +| FI | string | ✅ | "fi" | +| FR | string | ✅ | "fr" | +| GF | string | ✅ | "gf" | +| PF | string | ✅ | "pf" | +| TF | string | ✅ | "tf" | +| GA | string | ✅ | "ga" | +| GM | string | ✅ | "gm" | +| GE | string | ✅ | "ge" | +| DE | string | ✅ | "de" | +| GH | string | ✅ | "gh" | +| GI | string | ✅ | "gi" | +| GR | string | ✅ | "gr" | +| GL | string | ✅ | "gl" | +| GD | string | ✅ | "gd" | +| GP | string | ✅ | "gp" | +| GU | string | ✅ | "gu" | +| GT | string | ✅ | "gt" | +| GG | string | ✅ | "gg" | +| GN | string | ✅ | "gn" | +| GW | string | ✅ | "gw" | +| GY | string | ✅ | "gy" | +| HT | string | ✅ | "ht" | +| HM | string | ✅ | "hm" | +| VA | string | ✅ | "va" | +| HN | string | ✅ | "hn" | +| HK | string | ✅ | "hk" | +| HU | string | ✅ | "hu" | +| IS | string | ✅ | "is" | +| IN\_ | string | ✅ | "in" | +| ID | string | ✅ | "id" | +| IR | string | ✅ | "ir" | +| IQ | string | ✅ | "iq" | +| IE | string | ✅ | "ie" | +| IM | string | ✅ | "im" | +| IL | string | ✅ | "il" | +| IT | string | ✅ | "it" | +| JM | string | ✅ | "jm" | +| JP | string | ✅ | "jp" | +| JE | string | ✅ | "je" | +| JO | string | ✅ | "jo" | +| KZ | string | ✅ | "kz" | +| KE | string | ✅ | "ke" | +| KI | string | ✅ | "ki" | +| KP | string | ✅ | "kp" | +| KR | string | ✅ | "kr" | +| KW | string | ✅ | "kw" | +| KG | string | ✅ | "kg" | +| LA | string | ✅ | "la" | +| LV | string | ✅ | "lv" | +| LB | string | ✅ | "lb" | +| LS | string | ✅ | "ls" | +| LR | string | ✅ | "lr" | +| LY | string | ✅ | "ly" | +| LI | string | ✅ | "li" | +| LT | string | ✅ | "lt" | +| LU | string | ✅ | "lu" | +| MO | string | ✅ | "mo" | +| MG | string | ✅ | "mg" | +| MW | string | ✅ | "mw" | +| MY | string | ✅ | "my" | +| MV | string | ✅ | "mv" | +| ML | string | ✅ | "ml" | +| MT | string | ✅ | "mt" | +| MH | string | ✅ | "mh" | +| MQ | string | ✅ | "mq" | +| MR | string | ✅ | "mr" | +| MU | string | ✅ | "mu" | +| YT | string | ✅ | "yt" | +| MX | string | ✅ | "mx" | +| FM | string | ✅ | "fm" | +| MD | string | ✅ | "md" | +| MC | string | ✅ | "mc" | +| MN | string | ✅ | "mn" | +| ME | string | ✅ | "me" | +| MS | string | ✅ | "ms" | +| MA | string | ✅ | "ma" | +| MZ | string | ✅ | "mz" | +| MM | string | ✅ | "mm" | +| NA | string | ✅ | "na" | +| NR | string | ✅ | "nr" | +| NP | string | ✅ | "np" | +| NL | string | ✅ | "nl" | +| NC | string | ✅ | "nc" | +| NZ | string | ✅ | "nz" | +| NI | string | ✅ | "ni" | +| NE | string | ✅ | "ne" | +| NG | string | ✅ | "ng" | +| NU | string | ✅ | "nu" | +| NF | string | ✅ | "nf" | +| MP | string | ✅ | "mp" | +| NO | string | ✅ | "no" | +| OM | string | ✅ | "om" | +| PK | string | ✅ | "pk" | +| PW | string | ✅ | "pw" | +| PS | string | ✅ | "ps" | +| PA | string | ✅ | "pa" | +| PG | string | ✅ | "pg" | +| PY | string | ✅ | "py" | +| PE | string | ✅ | "pe" | +| PH | string | ✅ | "ph" | +| PN | string | ✅ | "pn" | +| PL | string | ✅ | "pl" | +| PT | string | ✅ | "pt" | +| PR | string | ✅ | "pr" | +| QA | string | ✅ | "qa" | +| MK | string | ✅ | "mk" | +| RO | string | ✅ | "ro" | +| RU | string | ✅ | "ru" | +| RW | string | ✅ | "rw" | +| RE | string | ✅ | "re" | +| BL | string | ✅ | "bl" | +| SH | string | ✅ | "sh" | +| KN | string | ✅ | "kn" | +| LC | string | ✅ | "lc" | +| MF | string | ✅ | "mf" | +| PM | string | ✅ | "pm" | +| VC | string | ✅ | "vc" | +| WS | string | ✅ | "ws" | +| SM | string | ✅ | "sm" | +| ST | string | ✅ | "st" | +| SA | string | ✅ | "sa" | +| SN | string | ✅ | "sn" | +| RS | string | ✅ | "rs" | +| SC | string | ✅ | "sc" | +| SL | string | ✅ | "sl" | +| SG | string | ✅ | "sg" | +| SX | string | ✅ | "sx" | +| SK | string | ✅ | "sk" | +| SI | string | ✅ | "si" | +| SB | string | ✅ | "sb" | +| SO | string | ✅ | "so" | +| ZA | string | ✅ | "za" | +| GS | string | ✅ | "gs" | +| SS | string | ✅ | "ss" | +| ES | string | ✅ | "es" | +| LK | string | ✅ | "lk" | +| SD | string | ✅ | "sd" | +| SR | string | ✅ | "sr" | +| SJ | string | ✅ | "sj" | +| SE | string | ✅ | "se" | +| CH | string | ✅ | "ch" | +| SY | string | ✅ | "sy" | +| TW | string | ✅ | "tw" | +| TJ | string | ✅ | "tj" | +| TZ | string | ✅ | "tz" | +| TH | string | ✅ | "th" | +| TL | string | ✅ | "tl" | +| TG | string | ✅ | "tg" | +| TK | string | ✅ | "tk" | +| TO | string | ✅ | "to" | +| TT | string | ✅ | "tt" | +| TN | string | ✅ | "tn" | +| TR | string | ✅ | "tr" | +| TM | string | ✅ | "tm" | +| TC | string | ✅ | "tc" | +| TV | string | ✅ | "tv" | +| UG | string | ✅ | "ug" | +| UA | string | ✅ | "ua" | +| AE | string | ✅ | "ae" | +| GB | string | ✅ | "gb" | +| UM | string | ✅ | "um" | +| US | string | ✅ | "us" | +| UY | string | ✅ | "uy" | +| UZ | string | ✅ | "uz" | +| VU | string | ✅ | "vu" | +| VE | string | ✅ | "ve" | +| VN | string | ✅ | "vn" | +| VG | string | ✅ | "vg" | +| VI | string | ✅ | "vi" | +| WF | string | ✅ | "wf" | +| EH | string | ✅ | "eh" | +| YE | string | ✅ | "ye" | +| ZM | string | ✅ | "zm" | +| ZW | string | ✅ | "zw" | +| AX | string | ✅ | "ax" | diff --git a/documentation/models/CreateContainer.md b/documentation/models/CreateContainer.md new file mode 100644 index 0000000..0d2313e --- /dev/null +++ b/documentation/models/CreateContainer.md @@ -0,0 +1,181 @@ +# CreateContainer + +Represents a container + +**Properties** + +| Name | Type | Required | Description | +| :--------------------- | :------------------------------------ | :------- | :----------------------------------------------------------------------------------------------- | +| image | string | ✅ | | +| resources | ContainerResourceRequirements | ✅ | Represents a container resource requirements | +| command | string[] | ❌ | Pass a command (and optional arguments) to override the ENTRYPOINT and CMD of a container image. | +| priority | ContainerGroupPriority | ❌ | | +| environmentVariables | any | ❌ | | +| logging | CreateContainerLogging | ❌ | | +| registryAuthentication | CreateContainerRegistryAuthentication | ❌ | | + +# CreateContainerLogging + +**Properties** + +| Name | Type | Required | Description | +| :------- | :--------------- | :------- | :---------- | +| axiom | LoggingAxiom2 | ❌ | | +| datadog | LoggingDatadog2 | ❌ | | +| newRelic | LoggingNewRelic2 | ❌ | | +| splunk | LoggingSplunk2 | ❌ | | +| tcp | LoggingTcp2 | ❌ | | +| http | LoggingHttp2 | ❌ | | + +# LoggingAxiom2 + +**Properties** + +| Name | Type | Required | Description | +| :------- | :----- | :------- | :---------- | +| host | string | ✅ | | +| apiToken | string | ✅ | | +| dataset | string | ✅ | | + +# LoggingDatadog2 + +**Properties** + +| Name | Type | Required | Description | +| :----- | :------------- | :------- | :---------- | +| host | string | ✅ | | +| apiKey | string | ✅ | | +| tags | DatadogTags2[] | ❌ | | + +# DatadogTags2 + +**Properties** + +| Name | Type | Required | Description | +| :---- | :----- | :------- | :---------- | +| name | string | ✅ | | +| value | string | ✅ | | + +# LoggingNewRelic2 + +**Properties** + +| Name | Type | Required | Description | +| :----------- | :----- | :------- | :---------- | +| host | string | ✅ | | +| ingestionKey | string | ✅ | | + +# LoggingSplunk2 + +**Properties** + +| Name | Type | Required | Description | +| :---- | :----- | :------- | :---------- | +| host | string | ✅ | | +| token | string | ✅ | | + +# LoggingTcp2 + +**Properties** + +| Name | Type | Required | Description | +| :--- | :----- | :------- | :---------- | +| host | string | ✅ | | +| port | number | ✅ | | + +# LoggingHttp2 + +**Properties** + +| Name | Type | Required | Description | +| :---------- | :--------------- | :------- | :---------- | +| host | string | ✅ | | +| port | number | ✅ | | +| format | HttpFormat2 | ✅ | | +| compression | HttpCompression2 | ✅ | | +| user | string | ❌ | | +| password | string | ❌ | | +| path | string | ❌ | | +| headers | HttpHeaders3[] | ❌ | | + +# HttpFormat2 + +**Properties** + +| Name | Type | Required | Description | +| :-------- | :----- | :------- | :----------- | +| JSON | string | ✅ | "json" | +| JSONLINES | string | ✅ | "json_lines" | + +# HttpCompression2 + +**Properties** + +| Name | Type | Required | Description | +| :--- | :----- | :------- | :---------- | +| NONE | string | ✅ | "none" | +| GZIP | string | ✅ | "gzip" | + +# HttpHeaders3 + +**Properties** + +| Name | Type | Required | Description | +| :---- | :----- | :------- | :---------- | +| name | string | ✅ | | +| value | string | ✅ | | + +# CreateContainerRegistryAuthentication + +**Properties** + +| Name | Type | Required | Description | +| :-------- | :------------------------------- | :------- | :---------- | +| basic | RegistryAuthenticationBasic1 | ❌ | | +| gcpGcr | RegistryAuthenticationGcpGcr1 | ❌ | | +| awsEcr | RegistryAuthenticationAwsEcr1 | ❌ | | +| dockerHub | RegistryAuthenticationDockerHub1 | ❌ | | +| gcpGar | RegistryAuthenticationGcpGar1 | ❌ | | + +# RegistryAuthenticationBasic1 + +**Properties** + +| Name | Type | Required | Description | +| :------- | :----- | :------- | :---------- | +| username | string | ✅ | | +| password | string | ✅ | | + +# RegistryAuthenticationGcpGcr1 + +**Properties** + +| Name | Type | Required | Description | +| :--------- | :----- | :------- | :---------- | +| serviceKey | string | ✅ | | + +# RegistryAuthenticationAwsEcr1 + +**Properties** + +| Name | Type | Required | Description | +| :-------------- | :----- | :------- | :---------- | +| accessKeyId | string | ✅ | | +| secretAccessKey | string | ✅ | | + +# RegistryAuthenticationDockerHub1 + +**Properties** + +| Name | Type | Required | Description | +| :------------------ | :----- | :------- | :---------- | +| username | string | ✅ | | +| personalAccessToken | string | ✅ | | + +# RegistryAuthenticationGcpGar1 + +**Properties** + +| Name | Type | Required | Description | +| :--------- | :----- | :------- | :---------- | +| serviceKey | string | ✅ | | diff --git a/documentation/models/CreateContainerGroup.md b/documentation/models/CreateContainerGroup.md new file mode 100644 index 0000000..c14ed22 --- /dev/null +++ b/documentation/models/CreateContainerGroup.md @@ -0,0 +1,20 @@ +# CreateContainerGroup + +Represents a request to create a container group + +**Properties** + +| Name | Type | Required | Description | +| :-------------- | :----------------------------- | :------- | :---------------------------------------------------------------------------------------------- | +| name | string | ✅ | | +| container | CreateContainer | ✅ | Represents a container | +| autostartPolicy | boolean | ✅ | | +| restartPolicy | ContainerRestartPolicy | ✅ | | +| replicas | number | ✅ | | +| displayName | string | ❌ | | +| countryCodes | CountryCode[] | ❌ | List of countries nodes must be located in. Remove this field to permit nodes from any country. | +| networking | CreateContainerGroupNetworking | ❌ | Represents container group networking parameters | +| livenessProbe | ContainerGroupLivenessProbe | ❌ | Represents the container group liveness probe | +| readinessProbe | ContainerGroupReadinessProbe | ❌ | Represents the container group readiness probe | +| startupProbe | ContainerGroupStartupProbe | ❌ | Represents the container group startup probe | +| queueConnection | ContainerGroupQueueConnection | ❌ | Represents container group queue connection | diff --git a/documentation/models/CreateContainerGroupNetworking.md b/documentation/models/CreateContainerGroupNetworking.md new file mode 100644 index 0000000..8a670a8 --- /dev/null +++ b/documentation/models/CreateContainerGroupNetworking.md @@ -0,0 +1,11 @@ +# CreateContainerGroupNetworking + +Represents container group networking parameters + +**Properties** + +| Name | Type | Required | Description | +| :------- | :-------------------------- | :------- | :---------- | +| protocol | ContainerNetworkingProtocol | ✅ | | +| port | number | ✅ | | +| auth | boolean | ✅ | | diff --git a/documentation/models/CreateInferenceEndpointJob.md b/documentation/models/CreateInferenceEndpointJob.md new file mode 100644 index 0000000..7ddeb9f --- /dev/null +++ b/documentation/models/CreateInferenceEndpointJob.md @@ -0,0 +1,11 @@ +# CreateInferenceEndpointJob + +Represents a request to create a inference endpoint job + +**Properties** + +| Name | Type | Required | Description | +| :------- | :----- | :------- | :------------------------------------ | +| input | any | ✅ | The job input. May be any valid JSON. | +| metadata | any | ❌ | | +| webhook | string | ❌ | | diff --git a/documentation/models/CreateQueue.md b/documentation/models/CreateQueue.md new file mode 100644 index 0000000..efdc562 --- /dev/null +++ b/documentation/models/CreateQueue.md @@ -0,0 +1,11 @@ +# CreateQueue + +Represents a request to create a queue + +**Properties** + +| Name | Type | Required | Description | +| :---------- | :----- | :------- | :-------------- | +| name | string | ✅ | | +| displayName | string | ❌ | | +| description | string | ❌ | The description | diff --git a/documentation/models/CreateQueueJob.md b/documentation/models/CreateQueueJob.md new file mode 100644 index 0000000..e92d726 --- /dev/null +++ b/documentation/models/CreateQueueJob.md @@ -0,0 +1,11 @@ +# CreateQueueJob + +Represents a request to create a queue job + +**Properties** + +| Name | Type | Required | Description | +| :------- | :----- | :------- | :------------------------------------ | +| input | any | ✅ | The job input. May be any valid JSON. | +| metadata | any | ❌ | | +| webhook | string | ❌ | | diff --git a/documentation/models/GpuClass.md b/documentation/models/GpuClass.md new file mode 100644 index 0000000..ad15fc6 --- /dev/null +++ b/documentation/models/GpuClass.md @@ -0,0 +1,12 @@ +# GpuClass + +Represents a GPU Class + +**Properties** + +| Name | Type | Required | Description | +| :----------- | :-------------- | :------- | :--------------------------------------------------- | +| id | string | ✅ | The unique identifier | +| name | string | ✅ | The GPU class name | +| prices | GpuClassPrice[] | ✅ | The list of prices for each container group priority | +| isHighDemand | boolean | ❌ | Whether the GPU class is in high demand | diff --git a/documentation/models/GpuClassPrice.md b/documentation/models/GpuClassPrice.md new file mode 100644 index 0000000..21965ad --- /dev/null +++ b/documentation/models/GpuClassPrice.md @@ -0,0 +1,10 @@ +# GpuClassPrice + +Represents the price of a GPU class for a given container group priority + +**Properties** + +| Name | Type | Required | Description | +| :------- | :--------------------- | :------- | :---------- | +| priority | ContainerGroupPriority | ✅ | | +| price | string | ✅ | The price | diff --git a/documentation/models/GpuClassesList.md b/documentation/models/GpuClassesList.md new file mode 100644 index 0000000..b231c28 --- /dev/null +++ b/documentation/models/GpuClassesList.md @@ -0,0 +1,9 @@ +# GpuClassesList + +Represents a list of GPU classes + +**Properties** + +| Name | Type | Required | Description | +| :---- | :--------- | :------- | :---------------------- | +| items | GpuClass[] | ✅ | The list of GPU classes | diff --git a/documentation/models/InferenceEndpoint.md b/documentation/models/InferenceEndpoint.md new file mode 100644 index 0000000..a16e3b0 --- /dev/null +++ b/documentation/models/InferenceEndpoint.md @@ -0,0 +1,16 @@ +# InferenceEndpoint + +Represents an inference endpoint + +**Properties** + +| Name | Type | Required | Description | +| :--------------- | :----- | :------- | :-------------------------------------------------------------------------- | +| id | string | ✅ | The unique identifier | +| name | string | ✅ | The inference endpoint name | +| displayName | string | ✅ | The inference endpoint display name | +| description | string | ✅ | a brief description of the inference endpoint | +| endpointUrl | string | ✅ | The URL of the inference endpoint | +| readme | string | ✅ | A markdown file containing a detailed description of the inference endpoint | +| priceDescription | string | ✅ | A description of the price | +| iconImage | string | ✅ | The URL of the icon image | diff --git a/documentation/models/InferenceEndpointJob.md b/documentation/models/InferenceEndpointJob.md new file mode 100644 index 0000000..9b8fe48 --- /dev/null +++ b/documentation/models/InferenceEndpointJob.md @@ -0,0 +1,31 @@ +# InferenceEndpointJob + +Represents a inference endpoint job + +**Properties** + +| Name | Type | Required | Description | +| :-------------------- | :-------------------------- | :------- | :------------------------------------- | +| id | string | ✅ | | +| input | any | ✅ | The job input. May be any valid JSON. | +| inferenceEndpointName | string | ✅ | The inference endpoint name | +| status | InferenceEndpointJobStatus | ✅ | | +| events | InferenceEndpointJobEvent[] | ✅ | | +| organizationName | string | ✅ | The organization name | +| createTime | string | ✅ | | +| updateTime | string | ✅ | | +| metadata | any | ❌ | | +| webhook | string | ❌ | | +| output | any | ❌ | The job output. May be any valid JSON. | + +# InferenceEndpointJobStatus + +**Properties** + +| Name | Type | Required | Description | +| :-------- | :----- | :------- | :---------- | +| PENDING | string | ✅ | "pending" | +| RUNNING | string | ✅ | "running" | +| SUCCEEDED | string | ✅ | "succeeded" | +| CANCELLED | string | ✅ | "cancelled" | +| FAILED | string | ✅ | "failed" | diff --git a/documentation/models/InferenceEndpointJobEvent.md b/documentation/models/InferenceEndpointJobEvent.md new file mode 100644 index 0000000..fc2e14c --- /dev/null +++ b/documentation/models/InferenceEndpointJobEvent.md @@ -0,0 +1,22 @@ +# InferenceEndpointJobEvent + +Represents an event for inference endpoint job + +**Properties** + +| Name | Type | Required | Description | +| :----- | :------------------------------ | :------- | :---------- | +| action | InferenceEndpointJobEventAction | ✅ | | +| time | string | ✅ | | + +# InferenceEndpointJobEventAction + +**Properties** + +| Name | Type | Required | Description | +| :-------- | :----- | :------- | :---------- | +| CREATED | string | ✅ | "created" | +| STARTED | string | ✅ | "started" | +| SUCCEEDED | string | ✅ | "succeeded" | +| CANCELLED | string | ✅ | "cancelled" | +| FAILED | string | ✅ | "failed" | diff --git a/documentation/models/InferenceEndpointJobList.md b/documentation/models/InferenceEndpointJobList.md new file mode 100644 index 0000000..d29afd4 --- /dev/null +++ b/documentation/models/InferenceEndpointJobList.md @@ -0,0 +1,9 @@ +# InferenceEndpointJobList + +Represents a list of inference endpoint jobs + +**Properties** + +| Name | Type | Required | Description | +| :---- | :--------------------- | :------- | :---------------- | +| items | InferenceEndpointJob[] | ✅ | The list of items | diff --git a/documentation/models/InferenceEndpointsList.md b/documentation/models/InferenceEndpointsList.md new file mode 100644 index 0000000..badebb8 --- /dev/null +++ b/documentation/models/InferenceEndpointsList.md @@ -0,0 +1,9 @@ +# InferenceEndpointsList + +Represents a list of inference endpoints + +**Properties** + +| Name | Type | Required | Description | +| :---- | :------------------ | :------- | :---------------- | +| items | InferenceEndpoint[] | ✅ | The list of items | diff --git a/documentation/models/Queue.md b/documentation/models/Queue.md new file mode 100644 index 0000000..75538eb --- /dev/null +++ b/documentation/models/Queue.md @@ -0,0 +1,15 @@ +# Queue + +Represents a queue + +**Properties** + +| Name | Type | Required | Description | +| :-------------- | :--------------- | :------- | :-------------- | +| id | string | ✅ | | +| name | string | ✅ | | +| displayName | string | ✅ | | +| containerGroups | ContainerGroup[] | ✅ | | +| createTime | string | ✅ | | +| updateTime | string | ✅ | | +| description | string | ❌ | The description | diff --git a/documentation/models/QueueJob.md b/documentation/models/QueueJob.md new file mode 100644 index 0000000..a7ad28d --- /dev/null +++ b/documentation/models/QueueJob.md @@ -0,0 +1,29 @@ +# QueueJob + +Represents a queue job + +**Properties** + +| Name | Type | Required | Description | +| :--------- | :-------------- | :------- | :------------------------------------- | +| id | string | ✅ | | +| input | any | ✅ | The job input. May be any valid JSON. | +| status | QueueJobStatus | ✅ | | +| events | QueueJobEvent[] | ✅ | | +| createTime | string | ✅ | | +| updateTime | string | ✅ | | +| metadata | any | ❌ | | +| webhook | string | ❌ | | +| output | any | ❌ | The job output. May be any valid JSON. | + +# QueueJobStatus + +**Properties** + +| Name | Type | Required | Description | +| :-------- | :----- | :------- | :---------- | +| PENDING | string | ✅ | "pending" | +| RUNNING | string | ✅ | "running" | +| SUCCEEDED | string | ✅ | "succeeded" | +| CANCELLED | string | ✅ | "cancelled" | +| FAILED | string | ✅ | "failed" | diff --git a/documentation/models/QueueJobEvent.md b/documentation/models/QueueJobEvent.md new file mode 100644 index 0000000..e09d853 --- /dev/null +++ b/documentation/models/QueueJobEvent.md @@ -0,0 +1,22 @@ +# QueueJobEvent + +Represents an event for queue job + +**Properties** + +| Name | Type | Required | Description | +| :----- | :------------------ | :------- | :---------- | +| action | QueueJobEventAction | ✅ | | +| time | string | ✅ | | + +# QueueJobEventAction + +**Properties** + +| Name | Type | Required | Description | +| :-------- | :----- | :------- | :---------- | +| CREATED | string | ✅ | "created" | +| STARTED | string | ✅ | "started" | +| SUCCEEDED | string | ✅ | "succeeded" | +| CANCELLED | string | ✅ | "cancelled" | +| FAILED | string | ✅ | "failed" | diff --git a/documentation/models/QueueJobList.md b/documentation/models/QueueJobList.md new file mode 100644 index 0000000..7370d41 --- /dev/null +++ b/documentation/models/QueueJobList.md @@ -0,0 +1,9 @@ +# QueueJobList + +Represents a list of queue jobs + +**Properties** + +| Name | Type | Required | Description | +| :---- | :--------- | :------- | :---------- | +| items | QueueJob[] | ✅ | | diff --git a/documentation/models/QueueList.md b/documentation/models/QueueList.md new file mode 100644 index 0000000..98c4439 --- /dev/null +++ b/documentation/models/QueueList.md @@ -0,0 +1,9 @@ +# QueueList + +Represents a list of queues + +**Properties** + +| Name | Type | Required | Description | +| :---- | :------ | :------- | :---------- | +| items | Queue[] | ✅ | | diff --git a/documentation/models/Quotas.md b/documentation/models/Quotas.md new file mode 100644 index 0000000..67f3a37 --- /dev/null +++ b/documentation/models/Quotas.md @@ -0,0 +1,12 @@ +# Quotas + +Represents the organization quotas + +**Properties** + +| Name | Type | Required | Description | +| :-------------------- | :-------------------- | :------- | :------------------------------------- | +| containerGroupsQuotas | ContainerGroupsQuotas | ✅ | | +| recipesQuotas | RecipesQuotas | ✅ | | +| createTime | string | ❌ | The time the resource was created | +| updateTime | string | ❌ | The time the resource was last updated | diff --git a/documentation/models/RecipesQuotas.md b/documentation/models/RecipesQuotas.md new file mode 100644 index 0000000..5ca4a9f --- /dev/null +++ b/documentation/models/RecipesQuotas.md @@ -0,0 +1,8 @@ +# RecipesQuotas + +**Properties** + +| Name | Type | Required | Description | +| :-------------------------- | :----- | :------- | :---------- | +| maxCreatedRecipeDeployments | number | ✅ | | +| recipeInstanceQuota | number | ✅ | | diff --git a/documentation/models/UpdateContainer.md b/documentation/models/UpdateContainer.md new file mode 100644 index 0000000..9cfbe5b --- /dev/null +++ b/documentation/models/UpdateContainer.md @@ -0,0 +1,192 @@ +# UpdateContainer + +Represents an update container object + +**Properties** + +| Name | Type | Required | Description | +| :--------------------- | :------------------------------------ | :------- | :----------------------------------------------------------------------------------------------- | +| image | string | ❌ | | +| resources | Resources | ❌ | | +| command | string[] | ❌ | Pass a command (and optional arguments) to override the ENTRYPOINT and CMD of a container image. | +| priority | ContainerGroupPriority | ❌ | | +| environmentVariables | any | ❌ | | +| logging | UpdateContainerLogging | ❌ | | +| registryAuthentication | UpdateContainerRegistryAuthentication | ❌ | | + +# Resources + +**Properties** + +| Name | Type | Required | Description | +| :------------ | :------- | :------- | :---------- | +| cpu | number | ❌ | | +| memory | number | ❌ | | +| gpuClasses | string[] | ❌ | | +| storageAmount | number | ❌ | | + +# UpdateContainerLogging + +**Properties** + +| Name | Type | Required | Description | +| :------- | :--------------- | :------- | :---------- | +| axiom | LoggingAxiom3 | ❌ | | +| datadog | LoggingDatadog3 | ❌ | | +| newRelic | LoggingNewRelic3 | ❌ | | +| splunk | LoggingSplunk3 | ❌ | | +| tcp | LoggingTcp3 | ❌ | | +| http | LoggingHttp3 | ❌ | | + +# LoggingAxiom3 + +**Properties** + +| Name | Type | Required | Description | +| :------- | :----- | :------- | :---------- | +| host | string | ✅ | | +| apiToken | string | ✅ | | +| dataset | string | ✅ | | + +# LoggingDatadog3 + +**Properties** + +| Name | Type | Required | Description | +| :----- | :------------- | :------- | :---------- | +| host | string | ✅ | | +| apiKey | string | ✅ | | +| tags | DatadogTags3[] | ❌ | | + +# DatadogTags3 + +**Properties** + +| Name | Type | Required | Description | +| :---- | :----- | :------- | :---------- | +| name | string | ✅ | | +| value | string | ✅ | | + +# LoggingNewRelic3 + +**Properties** + +| Name | Type | Required | Description | +| :----------- | :----- | :------- | :---------- | +| host | string | ✅ | | +| ingestionKey | string | ✅ | | + +# LoggingSplunk3 + +**Properties** + +| Name | Type | Required | Description | +| :---- | :----- | :------- | :---------- | +| host | string | ✅ | | +| token | string | ✅ | | + +# LoggingTcp3 + +**Properties** + +| Name | Type | Required | Description | +| :--- | :----- | :------- | :---------- | +| host | string | ✅ | | +| port | number | ✅ | | + +# LoggingHttp3 + +**Properties** + +| Name | Type | Required | Description | +| :---------- | :--------------- | :------- | :---------- | +| host | string | ✅ | | +| port | number | ✅ | | +| format | HttpFormat3 | ✅ | | +| compression | HttpCompression3 | ✅ | | +| user | string | ❌ | | +| password | string | ❌ | | +| path | string | ❌ | | +| headers | HttpHeaders4[] | ❌ | | + +# HttpFormat3 + +**Properties** + +| Name | Type | Required | Description | +| :-------- | :----- | :------- | :----------- | +| JSON | string | ✅ | "json" | +| JSONLINES | string | ✅ | "json_lines" | + +# HttpCompression3 + +**Properties** + +| Name | Type | Required | Description | +| :--- | :----- | :------- | :---------- | +| NONE | string | ✅ | "none" | +| GZIP | string | ✅ | "gzip" | + +# HttpHeaders4 + +**Properties** + +| Name | Type | Required | Description | +| :---- | :----- | :------- | :---------- | +| name | string | ✅ | | +| value | string | ✅ | | + +# UpdateContainerRegistryAuthentication + +**Properties** + +| Name | Type | Required | Description | +| :-------- | :------------------------------- | :------- | :---------- | +| basic | RegistryAuthenticationBasic2 | ❌ | | +| gcpGcr | RegistryAuthenticationGcpGcr2 | ❌ | | +| awsEcr | RegistryAuthenticationAwsEcr2 | ❌ | | +| dockerHub | RegistryAuthenticationDockerHub2 | ❌ | | +| gcpGar | RegistryAuthenticationGcpGar2 | ❌ | | + +# RegistryAuthenticationBasic2 + +**Properties** + +| Name | Type | Required | Description | +| :------- | :----- | :------- | :---------- | +| username | string | ✅ | | +| password | string | ✅ | | + +# RegistryAuthenticationGcpGcr2 + +**Properties** + +| Name | Type | Required | Description | +| :--------- | :----- | :------- | :---------- | +| serviceKey | string | ✅ | | + +# RegistryAuthenticationAwsEcr2 + +**Properties** + +| Name | Type | Required | Description | +| :-------------- | :----- | :------- | :---------- | +| accessKeyId | string | ✅ | | +| secretAccessKey | string | ✅ | | + +# RegistryAuthenticationDockerHub2 + +**Properties** + +| Name | Type | Required | Description | +| :------------------ | :----- | :------- | :---------- | +| username | string | ✅ | | +| personalAccessToken | string | ✅ | | + +# RegistryAuthenticationGcpGar2 + +**Properties** + +| Name | Type | Required | Description | +| :--------- | :----- | :------- | :---------- | +| serviceKey | string | ✅ | | diff --git a/documentation/models/UpdateContainerGroup.md b/documentation/models/UpdateContainerGroup.md new file mode 100644 index 0000000..97a33d0 --- /dev/null +++ b/documentation/models/UpdateContainerGroup.md @@ -0,0 +1,16 @@ +# UpdateContainerGroup + +Represents a request to update a container group + +**Properties** + +| Name | Type | Required | Description | +| :------------- | :----------------------------- | :------- | :---------------------------------------------------------------------------------------------- | +| displayName | string | ❌ | | +| container | UpdateContainer | ❌ | Represents an update container object | +| replicas | number | ❌ | | +| countryCodes | CountryCode[] | ❌ | List of countries nodes must be located in. Remove this field to permit nodes from any country. | +| networking | UpdateContainerGroupNetworking | ❌ | Represents update container group networking parameters | +| livenessProbe | ContainerGroupLivenessProbe | ❌ | Represents the container group liveness probe | +| readinessProbe | ContainerGroupReadinessProbe | ❌ | Represents the container group readiness probe | +| startupProbe | ContainerGroupStartupProbe | ❌ | Represents the container group startup probe | diff --git a/documentation/models/UpdateContainerGroupNetworking.md b/documentation/models/UpdateContainerGroupNetworking.md new file mode 100644 index 0000000..e5587a8 --- /dev/null +++ b/documentation/models/UpdateContainerGroupNetworking.md @@ -0,0 +1,9 @@ +# UpdateContainerGroupNetworking + +Represents update container group networking parameters + +**Properties** + +| Name | Type | Required | Description | +| :--- | :----- | :------- | :---------- | +| port | number | ❌ | | diff --git a/documentation/models/UpdateQueue.md b/documentation/models/UpdateQueue.md new file mode 100644 index 0000000..6fba0a6 --- /dev/null +++ b/documentation/models/UpdateQueue.md @@ -0,0 +1,10 @@ +# UpdateQueue + +Represents a request to update a queue + +**Properties** + +| Name | Type | Required | Description | +| :---------- | :----- | :------- | :-------------- | +| displayName | string | ❌ | | +| description | string | ❌ | The description | diff --git a/documentation/models/WebhookSecretKey.md b/documentation/models/WebhookSecretKey.md new file mode 100644 index 0000000..864d476 --- /dev/null +++ b/documentation/models/WebhookSecretKey.md @@ -0,0 +1,9 @@ +# WebhookSecretKey + +Represents a webhook secret key + +**Properties** + +| Name | Type | Required | Description | +| :-------- | :----- | :------- | :--------------------- | +| secretKey | string | ✅ | The webhook secret key | diff --git a/documentation/models/WorkloadError.md b/documentation/models/WorkloadError.md new file mode 100644 index 0000000..d0b0fb2 --- /dev/null +++ b/documentation/models/WorkloadError.md @@ -0,0 +1,15 @@ +# WorkloadError + +Represents a workload error + +**Properties** + +| Name | Type | Required | Description | +| :---------- | :----- | :------- | :---------- | +| detail | string | ✅ | | +| failedAt | string | ✅ | | +| instanceId | string | ✅ | | +| machineId | string | ✅ | | +| allocatedAt | string | ✅ | | +| version | number | ✅ | | +| startedAt | string | ❌ | | diff --git a/documentation/models/WorkloadErrorList.md b/documentation/models/WorkloadErrorList.md new file mode 100644 index 0000000..14b09f6 --- /dev/null +++ b/documentation/models/WorkloadErrorList.md @@ -0,0 +1,9 @@ +# WorkloadErrorList + +Represents a list of workload errors + +**Properties** + +| Name | Type | Required | Description | +| :---- | :-------------- | :------- | :---------- | +| items | WorkloadError[] | ✅ | | diff --git a/documentation/services/ContainerGroupsService.md b/documentation/services/ContainerGroupsService.md new file mode 100644 index 0000000..0b5157d --- /dev/null +++ b/documentation/services/ContainerGroupsService.md @@ -0,0 +1,888 @@ +# ContainerGroupsService + +A list of all methods in the `ContainerGroupsService` service. Click on the method name to view detailed information about that method. + +| Methods | Description | +| :-------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------- | +| [listContainerGroups](#listcontainergroups) | Gets the list of container groups | +| [createContainerGroup](#createcontainergroup) | Creates a new container group | +| [getContainerGroup](#getcontainergroup) | Gets a container group | +| [updateContainerGroup](#updatecontainergroup) | Updates a container group | +| [deleteContainerGroup](#deletecontainergroup) | Deletes a container group | +| [startContainerGroup](#startcontainergroup) | Starts a container group | +| [stopContainerGroup](#stopcontainergroup) | Stops a container group | +| [listContainerGroupInstances](#listcontainergroupinstances) | Retrieves a list of container group instances | +| [getContainerGroupInstance](#getcontainergroupinstance) | Retrieves the details of a single instance within a container group by instance ID | +| [reallocateContainerGroupInstance](#reallocatecontainergroupinstance) | Remove a node from a workload and reallocate the workload to a different node | +| [recreateContainerGroupInstance](#recreatecontainergroupinstance) | Stops a container, destroys it, creates a new one without requiring the image to be downloaded again on a different node | +| [restartContainerGroupInstance](#restartcontainergroupinstance) | Restarts a workload on a node without reallocating it | + +## listContainerGroups + +Gets the list of container groups + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/containers` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :----- | :------- | :--------------------------- | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | + +**Return Type** + +`ContainerGroupList` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.listContainerGroups( + 'ep7fgeqvy6vfd66h1ewe-69h', + 'dpdhw0h4i3hwpdzw9', + ); + + console.log(data); +})(); +``` + +## createContainerGroup + +Creates a new container group + +- HTTP Method: `POST` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/containers` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :-------------------------------------------------------- | :------- | :--------------------------- | +| body | [CreateContainerGroup](../models/CreateContainerGroup.md) | ✅ | The request body. | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | + +**Return Type** + +`ContainerGroup` + +**Example Usage Code Snippet** + +```typescript +import { + ContainerGroupLivenessProbe, + ContainerGroupQueueConnection, + ContainerGroupReadinessProbe, + ContainerGroupStartupProbe, + ContainerRestartPolicy, + CountryCode, + CreateContainer, + CreateContainerGroup, + CreateContainerGroupNetworking, + SaladCloudSdk, +} from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const containerResourceRequirements: ContainerResourceRequirements = { + cpu: 6, + memory: 8938, + gpuClasses: ['gpu_classes'], + storageAmount: 49533820101, + }; + + const containerGroupPriority = ContainerGroupPriority.HIGH; + + const loggingAxiom2: LoggingAxiom2 = { + host: 'amet et', + apiToken: 'nostrud in reprehenderit consequat', + dataset: 'Ut eu', + }; + + const datadogTags2: DatadogTags2 = { + name: 'name', + value: 'value', + }; + + const loggingDatadog2: LoggingDatadog2 = { + host: 'ut occaecat ex', + apiKey: 'sed fugiat magna sit', + tags: [datadogTags2], + }; + + const loggingNewRelic2: LoggingNewRelic2 = { + host: 'elit laboris enim', + ingestionKey: 'enim nulla', + }; + + const loggingSplunk2: LoggingSplunk2 = { + host: 'fugiat pariatur cupidatat amet', + token: 'in', + }; + + const loggingTcp2: LoggingTcp2 = { + host: 'in cupidatat proident magna exercitation', + port: 13910, + }; + + const httpFormat2 = HttpFormat2.JSON; + + const httpHeaders3: HttpHeaders3 = { + name: 'name', + value: 'value', + }; + + const httpCompression2 = HttpCompression2.NONE; + + const loggingHttp2: LoggingHttp2 = { + host: 'do', + port: 36577, + user: 'user', + password: 'password', + path: 'path', + format: httpFormat2, + headers: [httpHeaders3], + compression: httpCompression2, + }; + + const createContainerLogging: CreateContainerLogging = { + axiom: loggingAxiom2, + datadog: loggingDatadog2, + newRelic: loggingNewRelic2, + splunk: loggingSplunk2, + tcp: loggingTcp2, + http: loggingHttp2, + }; + + const registryAuthenticationBasic1: RegistryAuthenticationBasic1 = { + username: 'username', + password: 'password', + }; + + const registryAuthenticationGcpGcr1: RegistryAuthenticationGcpGcr1 = { + serviceKey: 'service_key', + }; + + const registryAuthenticationAwsEcr1: RegistryAuthenticationAwsEcr1 = { + accessKeyId: 'access_key_id', + secretAccessKey: 'secret_access_key', + }; + + const registryAuthenticationDockerHub1: RegistryAuthenticationDockerHub1 = { + username: 'username', + personalAccessToken: 'personal_access_token', + }; + + const registryAuthenticationGcpGar1: RegistryAuthenticationGcpGar1 = { + serviceKey: 'service_key', + }; + + const createContainerRegistryAuthentication: CreateContainerRegistryAuthentication = { + basic: registryAuthenticationBasic1, + gcpGcr: registryAuthenticationGcpGcr1, + awsEcr: registryAuthenticationAwsEcr1, + dockerHub: registryAuthenticationDockerHub1, + gcpGar: registryAuthenticationGcpGar1, + }; + + const createContainer: CreateContainer = { + image: 'magna laboris exercitation sunt', + resources: containerResourceRequirements, + command: ['command'], + priority: containerGroupPriority, + environmentVariables: [], + logging: createContainerLogging, + registryAuthentication: createContainerRegistryAuthentication, + }; + + const containerRestartPolicy = ContainerRestartPolicy.ALWAYS; + + const countryCode = CountryCode.AF; + + const containerNetworkingProtocol = ContainerNetworkingProtocol.HTTP; + + const createContainerGroupNetworking: CreateContainerGroupNetworking = { + protocol: containerNetworkingProtocol, + port: 26042, + auth: true, + }; + + const containerGroupProbeTcp: ContainerGroupProbeTcp = { + port: 58492, + }; + + const containerProbeHttpScheme = ContainerProbeHttpScheme.HTTP; + + const containerGroupProbeHttpHeaders2: ContainerGroupProbeHttpHeaders2 = { + name: 'name', + value: 'value', + }; + + const containerGroupProbeHttp: ContainerGroupProbeHttp = { + path: 'path', + port: 10866, + scheme: containerProbeHttpScheme, + headers: [containerGroupProbeHttpHeaders2], + }; + + const containerGroupProbeGrpc: ContainerGroupProbeGrpc = { + service: 'service', + port: 43992, + }; + + const containerGroupProbeExec: ContainerGroupProbeExec = { + command: ['command'], + }; + + const containerGroupLivenessProbe: ContainerGroupLivenessProbe = { + tcp: containerGroupProbeTcp, + http: containerGroupProbeHttp, + grpc: containerGroupProbeGrpc, + exec: containerGroupProbeExec, + initialDelaySeconds: 9, + periodSeconds: 10, + timeoutSeconds: 30, + successThreshold: 1, + failureThreshold: 3, + }; + + const containerGroupReadinessProbe: ContainerGroupReadinessProbe = { + tcp: containerGroupProbeTcp, + http: containerGroupProbeHttp, + grpc: containerGroupProbeGrpc, + exec: containerGroupProbeExec, + initialDelaySeconds: 10, + periodSeconds: 1, + timeoutSeconds: 1, + successThreshold: 1, + failureThreshold: 3, + }; + + const containerGroupStartupProbe: ContainerGroupStartupProbe = { + tcp: containerGroupProbeTcp, + http: containerGroupProbeHttp, + grpc: containerGroupProbeGrpc, + exec: containerGroupProbeExec, + initialDelaySeconds: 1, + periodSeconds: 3, + timeoutSeconds: 10, + successThreshold: 2, + failureThreshold: 1200, + }; + + const containerGroupQueueConnection: ContainerGroupQueueConnection = { + path: 'velit do tempor consequat', + port: 12759, + queueName: 'bwcr1macbu9hd9pgyexpjpio5ssrhv-fzk9udwt102odv6a5s5fynms2', + }; + + const createContainerGroup: CreateContainerGroup = { + name: 'vgm3', + displayName: 'qQx', + container: createContainer, + autostartPolicy: true, + restartPolicy: containerRestartPolicy, + replicas: 21, + countryCodes: [countryCode], + networking: createContainerGroupNetworking, + livenessProbe: containerGroupLivenessProbe, + readinessProbe: containerGroupReadinessProbe, + startupProbe: containerGroupStartupProbe, + queueConnection: containerGroupQueueConnection, + }; + + const { data } = await saladCloudSdk.containerGroups.createContainerGroup( + 'ep7fgeqvy6vfd66h1ewe-69h', + 'dpdhw0h4i3hwpdzw9', + input, + ); + + console.log(data); +})(); +``` + +## getContainerGroup + +Gets a container group + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}` + +**Parameters** + +| Name | Type | Required | Description | +| :----------------- | :----- | :------- | :------------------------------ | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| containerGroupName | string | ✅ | The unique container group name | + +**Return Type** + +`ContainerGroup` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.getContainerGroup( + 'zt-dvmb-gmo5a', + 'enqsq6na2w8d2wlvk-85d3jxhjhj', + 'fcixv6oyiqlk', + ); + + console.log(data); +})(); +``` + +## updateContainerGroup + +Updates a container group + +- HTTP Method: `PATCH` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}` + +**Parameters** + +| Name | Type | Required | Description | +| :----------------- | :-------------------------------------------------------- | :------- | :------------------------------ | +| body | [UpdateContainerGroup](../models/UpdateContainerGroup.md) | ✅ | The request body. | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| containerGroupName | string | ✅ | The unique container group name | + +**Return Type** + +`ContainerGroup` + +**Example Usage Code Snippet** + +```typescript +import { + ContainerGroupLivenessProbe, + ContainerGroupReadinessProbe, + ContainerGroupStartupProbe, + CountryCode, + SaladCloudSdk, + UpdateContainer, + UpdateContainerGroup, + UpdateContainerGroupNetworking, +} from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const resources: Resources = { + cpu: 3, + memory: 8954, + gpuClasses: ['gpu_classes'], + storageAmount: 38490522084, + }; + + const containerGroupPriority = ContainerGroupPriority.HIGH; + + const loggingAxiom3: LoggingAxiom3 = { + host: 'ipsum et', + apiToken: 'magna do pariatur dolor', + dataset: 'eiusmod mollit', + }; + + const datadogTags3: DatadogTags3 = { + name: 'name', + value: 'value', + }; + + const loggingDatadog3: LoggingDatadog3 = { + host: 'voluptate nisi sint consectetur', + apiKey: 'ea proident exercitation do', + tags: [datadogTags3], + }; + + const loggingNewRelic3: LoggingNewRelic3 = { + host: 'Lorem laborum nostrud enim ipsum', + ingestionKey: 'Ut nulla est cupidatat', + }; + + const loggingSplunk3: LoggingSplunk3 = { + host: 'in laboris', + token: 'aliqua incididunt Lorem ad sunt', + }; + + const loggingTcp3: LoggingTcp3 = { + host: 'voluptat', + port: 55775, + }; + + const httpFormat3 = HttpFormat3.JSON; + + const httpHeaders4: HttpHeaders4 = { + name: 'name', + value: 'value', + }; + + const httpCompression3 = HttpCompression3.NONE; + + const loggingHttp3: LoggingHttp3 = { + host: 'culpa sunt', + port: 21705, + user: 'user', + password: 'password', + path: 'path', + format: httpFormat3, + headers: [httpHeaders4], + compression: httpCompression3, + }; + + const updateContainerLogging: UpdateContainerLogging = { + axiom: loggingAxiom3, + datadog: loggingDatadog3, + newRelic: loggingNewRelic3, + splunk: loggingSplunk3, + tcp: loggingTcp3, + http: loggingHttp3, + }; + + const registryAuthenticationBasic2: RegistryAuthenticationBasic2 = { + username: 'username', + password: 'password', + }; + + const registryAuthenticationGcpGcr2: RegistryAuthenticationGcpGcr2 = { + serviceKey: 'service_key', + }; + + const registryAuthenticationAwsEcr2: RegistryAuthenticationAwsEcr2 = { + accessKeyId: 'access_key_id', + secretAccessKey: 'secret_access_key', + }; + + const registryAuthenticationDockerHub2: RegistryAuthenticationDockerHub2 = { + username: 'username', + personalAccessToken: 'personal_access_token', + }; + + const registryAuthenticationGcpGar2: RegistryAuthenticationGcpGar2 = { + serviceKey: 'service_key', + }; + + const updateContainerRegistryAuthentication: UpdateContainerRegistryAuthentication = { + basic: registryAuthenticationBasic2, + gcpGcr: registryAuthenticationGcpGcr2, + awsEcr: registryAuthenticationAwsEcr2, + dockerHub: registryAuthenticationDockerHub2, + gcpGar: registryAuthenticationGcpGar2, + }; + + const updateContainer: UpdateContainer = { + image: 'cupidatat officia', + resources: resources, + command: ['command'], + priority: containerGroupPriority, + environmentVariables: [], + logging: updateContainerLogging, + registryAuthentication: updateContainerRegistryAuthentication, + }; + + const countryCode = CountryCode.AF; + + const updateContainerGroupNetworking: UpdateContainerGroupNetworking = { + port: 41663, + }; + + const containerGroupProbeTcp: ContainerGroupProbeTcp = { + port: 58492, + }; + + const containerProbeHttpScheme = ContainerProbeHttpScheme.HTTP; + + const containerGroupProbeHttpHeaders2: ContainerGroupProbeHttpHeaders2 = { + name: 'name', + value: 'value', + }; + + const containerGroupProbeHttp: ContainerGroupProbeHttp = { + path: 'path', + port: 10866, + scheme: containerProbeHttpScheme, + headers: [containerGroupProbeHttpHeaders2], + }; + + const containerGroupProbeGrpc: ContainerGroupProbeGrpc = { + service: 'service', + port: 43992, + }; + + const containerGroupProbeExec: ContainerGroupProbeExec = { + command: ['command'], + }; + + const containerGroupLivenessProbe: ContainerGroupLivenessProbe = { + tcp: containerGroupProbeTcp, + http: containerGroupProbeHttp, + grpc: containerGroupProbeGrpc, + exec: containerGroupProbeExec, + initialDelaySeconds: 9, + periodSeconds: 10, + timeoutSeconds: 30, + successThreshold: 1, + failureThreshold: 3, + }; + + const containerGroupReadinessProbe: ContainerGroupReadinessProbe = { + tcp: containerGroupProbeTcp, + http: containerGroupProbeHttp, + grpc: containerGroupProbeGrpc, + exec: containerGroupProbeExec, + initialDelaySeconds: 10, + periodSeconds: 1, + timeoutSeconds: 1, + successThreshold: 1, + failureThreshold: 3, + }; + + const containerGroupStartupProbe: ContainerGroupStartupProbe = { + tcp: containerGroupProbeTcp, + http: containerGroupProbeHttp, + grpc: containerGroupProbeGrpc, + exec: containerGroupProbeExec, + initialDelaySeconds: 1, + periodSeconds: 3, + timeoutSeconds: 10, + successThreshold: 2, + failureThreshold: 1200, + }; + + const updateContainerGroup: UpdateContainerGroup = { + displayName: 'tbkBzZA6', + container: updateContainer, + replicas: 37, + countryCodes: [countryCode], + networking: updateContainerGroupNetworking, + livenessProbe: containerGroupLivenessProbe, + readinessProbe: containerGroupReadinessProbe, + startupProbe: containerGroupStartupProbe, + }; + + const { data } = await saladCloudSdk.containerGroups.updateContainerGroup( + 'zt-dvmb-gmo5a', + 'enqsq6na2w8d2wlvk-85d3jxhjhj', + 'fcixv6oyiqlk', + input, + ); + + console.log(data); +})(); +``` + +## deleteContainerGroup + +Deletes a container group + +- HTTP Method: `DELETE` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}` + +**Parameters** + +| Name | Type | Required | Description | +| :----------------- | :----- | :------- | :------------------------------ | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| containerGroupName | string | ✅ | The unique container group name | + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.deleteContainerGroup( + 'zt-dvmb-gmo5a', + 'enqsq6na2w8d2wlvk-85d3jxhjhj', + 'fcixv6oyiqlk', + ); + + console.log(data); +})(); +``` + +## startContainerGroup + +Starts a container group + +- HTTP Method: `POST` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/start` + +**Parameters** + +| Name | Type | Required | Description | +| :----------------- | :----- | :------- | :------------------------------ | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| containerGroupName | string | ✅ | The unique container group name | + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.startContainerGroup( + 'sm3eup0iqixen33w3mp1ln15pix00azjaxgfnuon5rnc', + 'kyp6oi0404lk6h', + 'ucuerglkiabi4sbb23l56oq87j1v654hdchyg-8n5glaql3-539c', + ); + + console.log(data); +})(); +``` + +## stopContainerGroup + +Stops a container group + +- HTTP Method: `POST` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/stop` + +**Parameters** + +| Name | Type | Required | Description | +| :----------------- | :----- | :------- | :------------------------------ | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| containerGroupName | string | ✅ | The unique container group name | + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.stopContainerGroup( + 'tytntnk7-le269faihpgelqal6jc7327027puoxjag6lmdgb0c3qeelc', + 's1m84-o8x59', + 't96e3mcxix0izfrbhlu3evx', + ); + + console.log(data); +})(); +``` + +## listContainerGroupInstances + +Retrieves a list of container group instances + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances` + +**Parameters** + +| Name | Type | Required | Description | +| :----------------- | :----- | :------- | :------------------------------ | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| containerGroupName | string | ✅ | The unique container group name | + +**Return Type** + +`ContainerGroupInstances` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.listContainerGroupInstances( + 'i5dt471e81flms65ujlnugscfp5-4x1xl1-c1ax257sioy7vldsm', + 'hwxbxx0fdtl98ziqbie46xqcbddvaoe06qhpuoplm89wi1', + 'y4q9cpfigd95ewlngasgx2e93zxeimrri0-iro9w0j3jvvgj2awj6-0ivo87g', + ); + + console.log(data); +})(); +``` + +## getContainerGroupInstance + +Retrieves the details of a single instance within a container group by instance ID + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}` + +**Parameters** + +| Name | Type | Required | Description | +| :----------------------- | :----- | :------- | :------------------------------ | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| containerGroupName | string | ✅ | The unique container group name | +| containerGroupInstanceId | string | ✅ | The unique instance identifier | + +**Return Type** + +`ContainerGroupInstance` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.getContainerGroupInstance( + 'cce0i3', + 'bb53k', + 'vtsp-47yvqix7', + 'container_group_instance_id', + ); + + console.log(data); +})(); +``` + +## reallocateContainerGroupInstance + +Remove a node from a workload and reallocate the workload to a different node + +- HTTP Method: `POST` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}/reallocate` + +**Parameters** + +| Name | Type | Required | Description | +| :----------------------- | :----- | :------- | :------------------------------ | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| containerGroupName | string | ✅ | The unique container group name | +| containerGroupInstanceId | string | ✅ | The unique instance identifier | + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.reallocateContainerGroupInstance( + 'e1831z2sf2i9bk6n01-l4p5c2u', + 'h86701y3xcmm3m3c1oqx1cbz9zmgggid8ddvtm74etd0oedpgesup', + 'zpw3lnw7ag07-nla57', + 'container_group_instance_id', + ); + + console.log(data); +})(); +``` + +## recreateContainerGroupInstance + +Stops a container, destroys it, creates a new one without requiring the image to be downloaded again on a different node + +- HTTP Method: `POST` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}/recreate` + +**Parameters** + +| Name | Type | Required | Description | +| :----------------------- | :----- | :------- | :------------------------------ | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| containerGroupName | string | ✅ | The unique container group name | +| containerGroupInstanceId | string | ✅ | The unique instance identifier | + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.recreateContainerGroupInstance( + 'xzg6rr4bm5841gi0z8-206cdrb7o1', + 'p6ls0enipujsrco8ums89jy5ldm9v9wniwlzg156f7f4hj66c1pcdqiziv', + 'lrb4rg8t0zwxs2l1ja3src79wfm1p-s-dl9lt39rn', + 'container_group_instance_id', + ); + + console.log(data); +})(); +``` + +## restartContainerGroupInstance + +Restarts a workload on a node without reallocating it + +- HTTP Method: `POST` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}/restart` + +**Parameters** + +| Name | Type | Required | Description | +| :----------------------- | :----- | :------- | :------------------------------ | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| containerGroupName | string | ✅ | The unique container group name | +| containerGroupInstanceId | string | ✅ | The unique instance identifier | + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.restartContainerGroupInstance( + 'pwt3jkl-373gjha9x4b8jfvgcvy-5z9eei5vo7ho3lx9fwf', + 'b6guf5mbszj1pjm7bnkx94c6wxjsm11-6l9gj1w78dzugvi1ay', + 'g3nf416-xd0f74r83g8t-3gf0nk0-ksf6kohlh6m-flte85e', + 'container_group_instance_id', + ); + + console.log(data); +})(); +``` diff --git a/documentation/services/InferenceEndpointsService.md b/documentation/services/InferenceEndpointsService.md new file mode 100644 index 0000000..88870f3 --- /dev/null +++ b/documentation/services/InferenceEndpointsService.md @@ -0,0 +1,242 @@ +# InferenceEndpointsService + +A list of all methods in the `InferenceEndpointsService` service. Click on the method name to view detailed information about that method. + +| Methods | Description | +| :-------------------------------------------------------- | :--------------------------------------------- | +| [listInferenceEndpoints](#listinferenceendpoints) | Gets the list of all inference endpoints | +| [getInferenceEndpoint](#getinferenceendpoint) | Gets an inference endpoint | +| [getInferenceEndpointJobs](#getinferenceendpointjobs) | Retrieves a list of an inference endpoint jobs | +| [createInferenceEndpointJob](#createinferenceendpointjob) | Creates a new job | +| [getInferenceEndpointJob](#getinferenceendpointjob) | Retrieves a job in an inference endpoint | +| [deleteInferenceEndpointJob](#deleteinferenceendpointjob) | Deletes an inference endpoint job | + +## listInferenceEndpoints + +Gets the list of all inference endpoints + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/inference-endpoints` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :----- | :------- | :--------------------------- | +| organizationName | string | ✅ | The unique organization name | +| page | number | ❌ | The page number | +| pageSize | number | ❌ | The number of items per page | + +**Return Type** + +`InferenceEndpointsList` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.inferenceEndpoints.listInferenceEndpoints('sqctlusaj22ygymnjifxur', { + page: 585200996, + pageSize: 35, + }); + + console.log(data); +})(); +``` + +## getInferenceEndpoint + +Gets an inference endpoint + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/inference-endpoints/{inference_endpoint_name}` + +**Parameters** + +| Name | Type | Required | Description | +| :-------------------- | :----- | :------- | :--------------------------------- | +| organizationName | string | ✅ | The unique organization name | +| inferenceEndpointName | string | ✅ | The unique inference endpoint name | + +**Return Type** + +`InferenceEndpoint` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.inferenceEndpoints.getInferenceEndpoint('rvbmdh-8zxih', 'id nulla'); + + console.log(data); +})(); +``` + +## getInferenceEndpointJobs + +Retrieves a list of an inference endpoint jobs + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/inference-endpoints/{inference_endpoint_name}/jobs` + +**Parameters** + +| Name | Type | Required | Description | +| :-------------------- | :----- | :------- | :--------------------------------- | +| organizationName | string | ✅ | The unique organization name | +| inferenceEndpointName | string | ✅ | The unique inference endpoint name | +| page | number | ❌ | The page number | +| pageSize | number | ❌ | The number of items per page | + +**Return Type** + +`InferenceEndpointJobList` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.inferenceEndpoints.getInferenceEndpointJobs('et0wus4xea-xt7p0xv', 'minim Ut s', { + page: 408174252, + pageSize: 59, + }); + + console.log(data); +})(); +``` + +## createInferenceEndpointJob + +Creates a new job + +- HTTP Method: `POST` +- Endpoint: `/organizations/{organization_name}/inference-endpoints/{inference_endpoint_name}/jobs` + +**Parameters** + +| Name | Type | Required | Description | +| :-------------------- | :-------------------------------------------------------------------- | :------- | :--------------------------------- | +| body | [CreateInferenceEndpointJob](../models/CreateInferenceEndpointJob.md) | ✅ | The request body. | +| organizationName | string | ✅ | The unique organization name | +| inferenceEndpointName | string | ✅ | The unique inference endpoint name | + +**Return Type** + +`InferenceEndpointJob` + +**Example Usage Code Snippet** + +```typescript +import { CreateInferenceEndpointJob, SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const createInferenceEndpointJob: CreateInferenceEndpointJob = { + input: [], + metadata: {}, + webhook: 'webhook', + }; + + const { data } = await saladCloudSdk.inferenceEndpoints.createInferenceEndpointJob( + 'et0wus4xea-xt7p0xv', + 'minim Ut s', + input, + ); + + console.log(data); +})(); +``` + +## getInferenceEndpointJob + +Retrieves a job in an inference endpoint + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/inference-endpoints/{inference_endpoint_name}/jobs/{inference_endpoint_job_id}` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------------- | :----- | :------- | :--------------------------------- | +| organizationName | string | ✅ | The unique organization name | +| inferenceEndpointName | string | ✅ | The unique inference endpoint name | +| inferenceEndpointJobId | string | ✅ | The unique job id | + +**Return Type** + +`InferenceEndpointJob` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.inferenceEndpoints.getInferenceEndpointJob( + 'wm7sq978nq8j748qskk0hr2eg4sl7t97a39br872', + 'ullamco', + 'inference_endpoint_job_id', + ); + + console.log(data); +})(); +``` + +## deleteInferenceEndpointJob + +Deletes an inference endpoint job + +- HTTP Method: `DELETE` +- Endpoint: `/organizations/{organization_name}/inference-endpoints/{inference_endpoint_name}/jobs/{inference_endpoint_job_id}` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------------- | :----- | :------- | :--------------------------------- | +| organizationName | string | ✅ | The unique organization name | +| inferenceEndpointName | string | ✅ | The unique inference endpoint name | +| inferenceEndpointJobId | string | ✅ | The unique job id | + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.inferenceEndpoints.deleteInferenceEndpointJob( + 'wm7sq978nq8j748qskk0hr2eg4sl7t97a39br872', + 'ullamco', + 'inference_endpoint_job_id', + ); + + console.log(data); +})(); +``` diff --git a/documentation/services/OrganizationDataService.md b/documentation/services/OrganizationDataService.md new file mode 100644 index 0000000..afaa1a7 --- /dev/null +++ b/documentation/services/OrganizationDataService.md @@ -0,0 +1,40 @@ +# OrganizationDataService + +A list of all methods in the `OrganizationDataService` service. Click on the method name to view detailed information about that method. + +| Methods | Description | +| :-------------------------------- | :------------------- | +| [listGpuClasses](#listgpuclasses) | List the GPU Classes | + +## listGpuClasses + +List the GPU Classes + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/gpu-classes` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :----- | :------- | :--------------------------- | +| organizationName | string | ✅ | The unique organization name | + +**Return Type** + +`GpuClassesList` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.organizationData.listGpuClasses('fux'); + + console.log(data); +})(); +``` diff --git a/documentation/services/QueuesService.md b/documentation/services/QueuesService.md new file mode 100644 index 0000000..7b8e5da --- /dev/null +++ b/documentation/services/QueuesService.md @@ -0,0 +1,387 @@ +# QueuesService + +A list of all methods in the `QueuesService` service. Click on the method name to view detailed information about that method. + +| Methods | Description | +| :-------------------------------- | :----------------------------- | +| [listQueues](#listqueues) | Gets the list of queues | +| [createQueue](#createqueue) | Creates a new queue | +| [getQueue](#getqueue) | Gets a queue | +| [updateQueue](#updatequeue) | Updates a queue | +| [deleteQueue](#deletequeue) | Deletes a queue | +| [listQueueJobs](#listqueuejobs) | Retrieves a list of queue jobs | +| [createQueueJob](#createqueuejob) | Creates a new job | +| [getQueueJob](#getqueuejob) | Retrieves a job in a queue | +| [deleteQueueJob](#deletequeuejob) | Deletes a queue job | + +## listQueues + +Gets the list of queues + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/queues` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :----- | :------- | :--------------------------- | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | + +**Return Type** + +`QueueList` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.queues.listQueues( + 'lwt38wqx9ycbbwq7cz7enua', + 'i5ohrcyvt0ap8jxyjtw5spbfh7ukelysoi13iija9co', + ); + + console.log(data); +})(); +``` + +## createQueue + +Creates a new queue + +- HTTP Method: `POST` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/queues` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :-------------------------------------- | :------- | :--------------------------- | +| body | [CreateQueue](../models/CreateQueue.md) | ✅ | The request body. | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | + +**Return Type** + +`Queue` + +**Example Usage Code Snippet** + +```typescript +import { CreateQueue, SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const createQueue: CreateQueue = { + name: 'ykm2ls08p3lv', + displayName: 'Av8HrM6.', + description: 'nulla enim', + }; + + const { data } = await saladCloudSdk.queues.createQueue( + 'lwt38wqx9ycbbwq7cz7enua', + 'i5ohrcyvt0ap8jxyjtw5spbfh7ukelysoi13iija9co', + input, + ); + + console.log(data); +})(); +``` + +## getQueue + +Gets a queue + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :----- | :------- | :--------------------------- | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| queueName | string | ✅ | The unique queue name | + +**Return Type** + +`Queue` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.queues.getQueue( + 'voe5nrfsnef63doc193sgdihl8bgcxw201b7qbn', + 'xlauk07eld4q4sm9jdgi4bgl1flz0elvw26099ougowft9j-kjp6bahz155', + 'gsomvfqk5h4gbc8o3p4id29bdadte3m51it2hfzxfmyjtvnd0b', + ); + + console.log(data); +})(); +``` + +## updateQueue + +Updates a queue + +- HTTP Method: `PATCH` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :-------------------------------------- | :------- | :--------------------------- | +| body | [UpdateQueue](../models/UpdateQueue.md) | ✅ | The request body. | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| queueName | string | ✅ | The unique queue name | + +**Return Type** + +`Queue` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk, UpdateQueue } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const updateQueue: UpdateQueue = { + displayName: 'X3iu1Xk', + description: 'ullamco consequat voluptate', + }; + + const { data } = await saladCloudSdk.queues.updateQueue( + 'voe5nrfsnef63doc193sgdihl8bgcxw201b7qbn', + 'xlauk07eld4q4sm9jdgi4bgl1flz0elvw26099ougowft9j-kjp6bahz155', + 'gsomvfqk5h4gbc8o3p4id29bdadte3m51it2hfzxfmyjtvnd0b', + input, + ); + + console.log(data); +})(); +``` + +## deleteQueue + +Deletes a queue + +- HTTP Method: `DELETE` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :----- | :------- | :--------------------------- | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| queueName | string | ✅ | The unique queue name | + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.queues.deleteQueue( + 'voe5nrfsnef63doc193sgdihl8bgcxw201b7qbn', + 'xlauk07eld4q4sm9jdgi4bgl1flz0elvw26099ougowft9j-kjp6bahz155', + 'gsomvfqk5h4gbc8o3p4id29bdadte3m51it2hfzxfmyjtvnd0b', + ); + + console.log(data); +})(); +``` + +## listQueueJobs + +Retrieves a list of queue jobs + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :----- | :------- | :--------------------------- | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| queueName | string | ✅ | The unique queue name | +| page | number | ❌ | The page number | +| pageSize | number | ❌ | The number of items per page | + +**Return Type** + +`QueueJobList` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.queues.listQueueJobs( + 'qiqiazzthr12lsqkk1iq35-ix3pzbff9-f8x8ls569n71', + 'ht3-tiei7j9ye5yzdixjzbx5ywjbd', + 'xp465rhqkyqstwpk8kd3jy5kakai4lollggq7i7xz97', + { + page: 1955049824, + pageSize: 95, + }, + ); + + console.log(data); +})(); +``` + +## createQueueJob + +Creates a new job + +- HTTP Method: `POST` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :-------------------------------------------- | :------- | :--------------------------- | +| body | [CreateQueueJob](../models/CreateQueueJob.md) | ✅ | The request body. | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| queueName | string | ✅ | The unique queue name | + +**Return Type** + +`QueueJob` + +**Example Usage Code Snippet** + +```typescript +import { CreateQueueJob, SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const createQueueJob: CreateQueueJob = { + input: [], + metadata: {}, + webhook: 'webhook', + }; + + const { data } = await saladCloudSdk.queues.createQueueJob( + 'qiqiazzthr12lsqkk1iq35-ix3pzbff9-f8x8ls569n71', + 'ht3-tiei7j9ye5yzdixjzbx5ywjbd', + 'xp465rhqkyqstwpk8kd3jy5kakai4lollggq7i7xz97', + input, + ); + + console.log(data); +})(); +``` + +## getQueueJob + +Retrieves a job in a queue + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs/{queue_job_id}` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :----- | :------- | :--------------------------- | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| queueName | string | ✅ | The unique queue name | +| queueJobId | string | ✅ | The unique job id | + +**Return Type** + +`QueueJob` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.queues.getQueueJob( + 'erx15rey11qozndq25fyep9cx1pky-znnuxifqcep9-zc', + 'x9-4z-1rr438ze1lo349hdscooit-lme54jb98rdf4itla-wc6aace', + 'e-tvw-8ybw4mj2a', + 'queue_job_id', + ); + + console.log(data); +})(); +``` + +## deleteQueueJob + +Deletes a queue job + +- HTTP Method: `DELETE` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs/{queue_job_id}` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :----- | :------- | :--------------------------- | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| queueName | string | ✅ | The unique queue name | +| queueJobId | string | ✅ | The unique job id | + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.queues.deleteQueueJob( + 'erx15rey11qozndq25fyep9cx1pky-znnuxifqcep9-zc', + 'x9-4z-1rr438ze1lo349hdscooit-lme54jb98rdf4itla-wc6aace', + 'e-tvw-8ybw4mj2a', + 'queue_job_id', + ); + + console.log(data); +})(); +``` diff --git a/documentation/services/QuotasService.md b/documentation/services/QuotasService.md new file mode 100644 index 0000000..1e9384e --- /dev/null +++ b/documentation/services/QuotasService.md @@ -0,0 +1,40 @@ +# QuotasService + +A list of all methods in the `QuotasService` service. Click on the method name to view detailed information about that method. + +| Methods | Description | +| :---------------------- | :--------------------------- | +| [getQuotas](#getquotas) | Gets the organization quotas | + +## getQuotas + +Gets the organization quotas + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/quotas` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :----- | :------- | :--------------------------- | +| organizationName | string | ✅ | The unique organization name | + +**Return Type** + +`Quotas` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.quotas.getQuotas('y-7yhh5v70xusg163gdfs9vma6wkyd2rcvosdiwny-k'); + + console.log(data); +})(); +``` diff --git a/documentation/services/WebhookSecretKeyService.md b/documentation/services/WebhookSecretKeyService.md new file mode 100644 index 0000000..5299642 --- /dev/null +++ b/documentation/services/WebhookSecretKeyService.md @@ -0,0 +1,78 @@ +# WebhookSecretKeyService + +A list of all methods in the `WebhookSecretKeyService` service. Click on the method name to view detailed information about that method. + +| Methods | Description | +| :------------------------------------------------ | :----------------------------- | +| [getWebhookSecretKey](#getwebhooksecretkey) | Gets the webhook secret key | +| [updateWebhookSecretKey](#updatewebhooksecretkey) | Updates the webhook secret key | + +## getWebhookSecretKey + +Gets the webhook secret key + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/webhook-secret-key` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :----- | :------- | :--------------------------- | +| organizationName | string | ✅ | The unique organization name | + +**Return Type** + +`WebhookSecretKey` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.webhookSecretKey.getWebhookSecretKey( + 'hn9h7px3wro2wjja0yeu6kcgk0nggtveqmh45ilbsw4b2dcch55e1sj', + ); + + console.log(data); +})(); +``` + +## updateWebhookSecretKey + +Updates the webhook secret key + +- HTTP Method: `POST` +- Endpoint: `/organizations/{organization_name}/webhook-secret-key` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------- | :----- | :------- | :--------------------------- | +| organizationName | string | ✅ | The unique organization name | + +**Return Type** + +`WebhookSecretKey` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.webhookSecretKey.updateWebhookSecretKey( + 'hn9h7px3wro2wjja0yeu6kcgk0nggtveqmh45ilbsw4b2dcch55e1sj', + ); + + console.log(data); +})(); +``` diff --git a/documentation/services/WorkloadErrorsService.md b/documentation/services/WorkloadErrorsService.md new file mode 100644 index 0000000..ac1a7ee --- /dev/null +++ b/documentation/services/WorkloadErrorsService.md @@ -0,0 +1,46 @@ +# WorkloadErrorsService + +A list of all methods in the `WorkloadErrorsService` service. Click on the method name to view detailed information about that method. + +| Methods | Description | +| :-------------------------------------- | :----------------------- | +| [getWorkloadErrors](#getworkloaderrors) | Gets the workload errors | + +## getWorkloadErrors + +Gets the workload errors + +- HTTP Method: `GET` +- Endpoint: `/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/errors` + +**Parameters** + +| Name | Type | Required | Description | +| :----------------- | :----- | :------- | :------------------------------ | +| organizationName | string | ✅ | The unique organization name | +| projectName | string | ✅ | The unique project name | +| containerGroupName | string | ✅ | The unique container group name | + +**Return Type** + +`WorkloadErrorList` + +**Example Usage Code Snippet** + +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.workloadErrors.getWorkloadErrors( + 'cg3m2ys7p7s0l7bztd09ndj7juif71slwjakka', + 'rcn12djtrq4osvz', + 'ha1vqw6i748x874akg4f74ap-5lo17i', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-gpu-classes-get.md b/documentation/snippets/organizations-{organization_name}-gpu-classes-get.md new file mode 100644 index 0000000..177357f --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-gpu-classes-get.md @@ -0,0 +1,13 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.organizationData.listGpuClasses('fux'); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-inference-endpoints-get.md b/documentation/snippets/organizations-{organization_name}-inference-endpoints-get.md new file mode 100644 index 0000000..0ccb6a4 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-inference-endpoints-get.md @@ -0,0 +1,16 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.inferenceEndpoints.listInferenceEndpoints('sqctlusaj22ygymnjifxur', { + page: 585200996, + pageSize: 35, + }); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-get.md b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-get.md new file mode 100644 index 0000000..4a2f1e1 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-get.md @@ -0,0 +1,13 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.inferenceEndpoints.getInferenceEndpoint('rvbmdh-8zxih', 'id nulla'); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-get.md b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-get.md new file mode 100644 index 0000000..39e132f --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-get.md @@ -0,0 +1,16 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.inferenceEndpoints.getInferenceEndpointJobs('et0wus4xea-xt7p0xv', 'minim Ut s', { + page: 408174252, + pageSize: 59, + }); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-post.md b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-post.md new file mode 100644 index 0000000..2d06a87 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-post.md @@ -0,0 +1,23 @@ +```typescript +import { CreateInferenceEndpointJob, SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const createInferenceEndpointJob: CreateInferenceEndpointJob = { + input: [], + metadata: {}, + webhook: 'webhook', + }; + + const { data } = await saladCloudSdk.inferenceEndpoints.createInferenceEndpointJob( + 'et0wus4xea-xt7p0xv', + 'minim Ut s', + input, + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-delete.md b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-delete.md new file mode 100644 index 0000000..a36fa01 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-delete.md @@ -0,0 +1,17 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.inferenceEndpoints.deleteInferenceEndpointJob( + 'wm7sq978nq8j748qskk0hr2eg4sl7t97a39br872', + 'ullamco', + 'inference_endpoint_job_id', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-get.md b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-get.md new file mode 100644 index 0000000..4cb3899 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-inference-endpoints-{inference_endpoint_name}-jobs-{inference_endpoint_job_id}-get.md @@ -0,0 +1,17 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.inferenceEndpoints.getInferenceEndpointJob( + 'wm7sq978nq8j748qskk0hr2eg4sl7t97a39br872', + 'ullamco', + 'inference_endpoint_job_id', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-get.md new file mode 100644 index 0000000..9f3b20a --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-get.md @@ -0,0 +1,16 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.listContainerGroups( + 'ep7fgeqvy6vfd66h1ewe-69h', + 'dpdhw0h4i3hwpdzw9', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-post.md new file mode 100644 index 0000000..38075df --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-post.md @@ -0,0 +1,235 @@ +```typescript +import { + ContainerGroupLivenessProbe, + ContainerGroupQueueConnection, + ContainerGroupReadinessProbe, + ContainerGroupStartupProbe, + ContainerRestartPolicy, + CountryCode, + CreateContainer, + CreateContainerGroup, + CreateContainerGroupNetworking, + SaladCloudSdk, +} from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const containerResourceRequirements: ContainerResourceRequirements = { + cpu: 6, + memory: 8938, + gpuClasses: ['gpu_classes'], + storageAmount: 49533820101, + }; + + const containerGroupPriority = ContainerGroupPriority.HIGH; + + const loggingAxiom2: LoggingAxiom2 = { + host: 'amet et', + apiToken: 'nostrud in reprehenderit consequat', + dataset: 'Ut eu', + }; + + const datadogTags2: DatadogTags2 = { + name: 'name', + value: 'value', + }; + + const loggingDatadog2: LoggingDatadog2 = { + host: 'ut occaecat ex', + apiKey: 'sed fugiat magna sit', + tags: [datadogTags2], + }; + + const loggingNewRelic2: LoggingNewRelic2 = { + host: 'elit laboris enim', + ingestionKey: 'enim nulla', + }; + + const loggingSplunk2: LoggingSplunk2 = { + host: 'fugiat pariatur cupidatat amet', + token: 'in', + }; + + const loggingTcp2: LoggingTcp2 = { + host: 'in cupidatat proident magna exercitation', + port: 13910, + }; + + const httpFormat2 = HttpFormat2.JSON; + + const httpHeaders3: HttpHeaders3 = { + name: 'name', + value: 'value', + }; + + const httpCompression2 = HttpCompression2.NONE; + + const loggingHttp2: LoggingHttp2 = { + host: 'do', + port: 36577, + user: 'user', + password: 'password', + path: 'path', + format: httpFormat2, + headers: [httpHeaders3], + compression: httpCompression2, + }; + + const createContainerLogging: CreateContainerLogging = { + axiom: loggingAxiom2, + datadog: loggingDatadog2, + newRelic: loggingNewRelic2, + splunk: loggingSplunk2, + tcp: loggingTcp2, + http: loggingHttp2, + }; + + const registryAuthenticationBasic1: RegistryAuthenticationBasic1 = { + username: 'username', + password: 'password', + }; + + const registryAuthenticationGcpGcr1: RegistryAuthenticationGcpGcr1 = { + serviceKey: 'service_key', + }; + + const registryAuthenticationAwsEcr1: RegistryAuthenticationAwsEcr1 = { + accessKeyId: 'access_key_id', + secretAccessKey: 'secret_access_key', + }; + + const registryAuthenticationDockerHub1: RegistryAuthenticationDockerHub1 = { + username: 'username', + personalAccessToken: 'personal_access_token', + }; + + const registryAuthenticationGcpGar1: RegistryAuthenticationGcpGar1 = { + serviceKey: 'service_key', + }; + + const createContainerRegistryAuthentication: CreateContainerRegistryAuthentication = { + basic: registryAuthenticationBasic1, + gcpGcr: registryAuthenticationGcpGcr1, + awsEcr: registryAuthenticationAwsEcr1, + dockerHub: registryAuthenticationDockerHub1, + gcpGar: registryAuthenticationGcpGar1, + }; + + const createContainer: CreateContainer = { + image: 'magna laboris exercitation sunt', + resources: containerResourceRequirements, + command: ['command'], + priority: containerGroupPriority, + environmentVariables: [], + logging: createContainerLogging, + registryAuthentication: createContainerRegistryAuthentication, + }; + + const containerRestartPolicy = ContainerRestartPolicy.ALWAYS; + + const countryCode = CountryCode.AF; + + const containerNetworkingProtocol = ContainerNetworkingProtocol.HTTP; + + const createContainerGroupNetworking: CreateContainerGroupNetworking = { + protocol: containerNetworkingProtocol, + port: 26042, + auth: true, + }; + + const containerGroupProbeTcp: ContainerGroupProbeTcp = { + port: 58492, + }; + + const containerProbeHttpScheme = ContainerProbeHttpScheme.HTTP; + + const containerGroupProbeHttpHeaders2: ContainerGroupProbeHttpHeaders2 = { + name: 'name', + value: 'value', + }; + + const containerGroupProbeHttp: ContainerGroupProbeHttp = { + path: 'path', + port: 10866, + scheme: containerProbeHttpScheme, + headers: [containerGroupProbeHttpHeaders2], + }; + + const containerGroupProbeGrpc: ContainerGroupProbeGrpc = { + service: 'service', + port: 43992, + }; + + const containerGroupProbeExec: ContainerGroupProbeExec = { + command: ['command'], + }; + + const containerGroupLivenessProbe: ContainerGroupLivenessProbe = { + tcp: containerGroupProbeTcp, + http: containerGroupProbeHttp, + grpc: containerGroupProbeGrpc, + exec: containerGroupProbeExec, + initialDelaySeconds: 9, + periodSeconds: 10, + timeoutSeconds: 30, + successThreshold: 1, + failureThreshold: 3, + }; + + const containerGroupReadinessProbe: ContainerGroupReadinessProbe = { + tcp: containerGroupProbeTcp, + http: containerGroupProbeHttp, + grpc: containerGroupProbeGrpc, + exec: containerGroupProbeExec, + initialDelaySeconds: 10, + periodSeconds: 1, + timeoutSeconds: 1, + successThreshold: 1, + failureThreshold: 3, + }; + + const containerGroupStartupProbe: ContainerGroupStartupProbe = { + tcp: containerGroupProbeTcp, + http: containerGroupProbeHttp, + grpc: containerGroupProbeGrpc, + exec: containerGroupProbeExec, + initialDelaySeconds: 1, + periodSeconds: 3, + timeoutSeconds: 10, + successThreshold: 2, + failureThreshold: 1200, + }; + + const containerGroupQueueConnection: ContainerGroupQueueConnection = { + path: 'velit do tempor consequat', + port: 12759, + queueName: 'bwcr1macbu9hd9pgyexpjpio5ssrhv-fzk9udwt102odv6a5s5fynms2', + }; + + const createContainerGroup: CreateContainerGroup = { + name: 'vgm3', + displayName: 'qQx', + container: createContainer, + autostartPolicy: true, + restartPolicy: containerRestartPolicy, + replicas: 21, + countryCodes: [countryCode], + networking: createContainerGroupNetworking, + livenessProbe: containerGroupLivenessProbe, + readinessProbe: containerGroupReadinessProbe, + startupProbe: containerGroupStartupProbe, + queueConnection: containerGroupQueueConnection, + }; + + const { data } = await saladCloudSdk.containerGroups.createContainerGroup( + 'ep7fgeqvy6vfd66h1ewe-69h', + 'dpdhw0h4i3hwpdzw9', + input, + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-delete.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-delete.md new file mode 100644 index 0000000..a546050 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-delete.md @@ -0,0 +1,17 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.deleteContainerGroup( + 'zt-dvmb-gmo5a', + 'enqsq6na2w8d2wlvk-85d3jxhjhj', + 'fcixv6oyiqlk', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-errors-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-errors-get.md new file mode 100644 index 0000000..4c07475 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-errors-get.md @@ -0,0 +1,17 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.workloadErrors.getWorkloadErrors( + 'cg3m2ys7p7s0l7bztd09ndj7juif71slwjakka', + 'rcn12djtrq4osvz', + 'ha1vqw6i748x874akg4f74ap-5lo17i', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-get.md new file mode 100644 index 0000000..20816a6 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-get.md @@ -0,0 +1,17 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.getContainerGroup( + 'zt-dvmb-gmo5a', + 'enqsq6na2w8d2wlvk-85d3jxhjhj', + 'fcixv6oyiqlk', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-get.md new file mode 100644 index 0000000..3cce55f --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-get.md @@ -0,0 +1,17 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.listContainerGroupInstances( + 'i5dt471e81flms65ujlnugscfp5-4x1xl1-c1ax257sioy7vldsm', + 'hwxbxx0fdtl98ziqbie46xqcbddvaoe06qhpuoplm89wi1', + 'y4q9cpfigd95ewlngasgx2e93zxeimrri0-iro9w0j3jvvgj2awj6-0ivo87g', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-get.md new file mode 100644 index 0000000..87c8930 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-get.md @@ -0,0 +1,18 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.getContainerGroupInstance( + 'cce0i3', + 'bb53k', + 'vtsp-47yvqix7', + 'container_group_instance_id', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-reallocate-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-reallocate-post.md new file mode 100644 index 0000000..cffaae8 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-reallocate-post.md @@ -0,0 +1,18 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.reallocateContainerGroupInstance( + 'e1831z2sf2i9bk6n01-l4p5c2u', + 'h86701y3xcmm3m3c1oqx1cbz9zmgggid8ddvtm74etd0oedpgesup', + 'zpw3lnw7ag07-nla57', + 'container_group_instance_id', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-recreate-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-recreate-post.md new file mode 100644 index 0000000..5f943ba --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-recreate-post.md @@ -0,0 +1,18 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.recreateContainerGroupInstance( + 'xzg6rr4bm5841gi0z8-206cdrb7o1', + 'p6ls0enipujsrco8ums89jy5ldm9v9wniwlzg156f7f4hj66c1pcdqiziv', + 'lrb4rg8t0zwxs2l1ja3src79wfm1p-s-dl9lt39rn', + 'container_group_instance_id', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-restart-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-restart-post.md new file mode 100644 index 0000000..669ef3a --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-instances-{container_group_instance_id}-restart-post.md @@ -0,0 +1,18 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.restartContainerGroupInstance( + 'pwt3jkl-373gjha9x4b8jfvgcvy-5z9eei5vo7ho3lx9fwf', + 'b6guf5mbszj1pjm7bnkx94c6wxjsm11-6l9gj1w78dzugvi1ay', + 'g3nf416-xd0f74r83g8t-3gf0nk0-ksf6kohlh6m-flte85e', + 'container_group_instance_id', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-patch.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-patch.md new file mode 100644 index 0000000..1a04986 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-patch.md @@ -0,0 +1,218 @@ +```typescript +import { + ContainerGroupLivenessProbe, + ContainerGroupReadinessProbe, + ContainerGroupStartupProbe, + CountryCode, + SaladCloudSdk, + UpdateContainer, + UpdateContainerGroup, + UpdateContainerGroupNetworking, +} from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const resources: Resources = { + cpu: 3, + memory: 8954, + gpuClasses: ['gpu_classes'], + storageAmount: 38490522084, + }; + + const containerGroupPriority = ContainerGroupPriority.HIGH; + + const loggingAxiom3: LoggingAxiom3 = { + host: 'ipsum et', + apiToken: 'magna do pariatur dolor', + dataset: 'eiusmod mollit', + }; + + const datadogTags3: DatadogTags3 = { + name: 'name', + value: 'value', + }; + + const loggingDatadog3: LoggingDatadog3 = { + host: 'voluptate nisi sint consectetur', + apiKey: 'ea proident exercitation do', + tags: [datadogTags3], + }; + + const loggingNewRelic3: LoggingNewRelic3 = { + host: 'Lorem laborum nostrud enim ipsum', + ingestionKey: 'Ut nulla est cupidatat', + }; + + const loggingSplunk3: LoggingSplunk3 = { + host: 'in laboris', + token: 'aliqua incididunt Lorem ad sunt', + }; + + const loggingTcp3: LoggingTcp3 = { + host: 'voluptat', + port: 55775, + }; + + const httpFormat3 = HttpFormat3.JSON; + + const httpHeaders4: HttpHeaders4 = { + name: 'name', + value: 'value', + }; + + const httpCompression3 = HttpCompression3.NONE; + + const loggingHttp3: LoggingHttp3 = { + host: 'culpa sunt', + port: 21705, + user: 'user', + password: 'password', + path: 'path', + format: httpFormat3, + headers: [httpHeaders4], + compression: httpCompression3, + }; + + const updateContainerLogging: UpdateContainerLogging = { + axiom: loggingAxiom3, + datadog: loggingDatadog3, + newRelic: loggingNewRelic3, + splunk: loggingSplunk3, + tcp: loggingTcp3, + http: loggingHttp3, + }; + + const registryAuthenticationBasic2: RegistryAuthenticationBasic2 = { + username: 'username', + password: 'password', + }; + + const registryAuthenticationGcpGcr2: RegistryAuthenticationGcpGcr2 = { + serviceKey: 'service_key', + }; + + const registryAuthenticationAwsEcr2: RegistryAuthenticationAwsEcr2 = { + accessKeyId: 'access_key_id', + secretAccessKey: 'secret_access_key', + }; + + const registryAuthenticationDockerHub2: RegistryAuthenticationDockerHub2 = { + username: 'username', + personalAccessToken: 'personal_access_token', + }; + + const registryAuthenticationGcpGar2: RegistryAuthenticationGcpGar2 = { + serviceKey: 'service_key', + }; + + const updateContainerRegistryAuthentication: UpdateContainerRegistryAuthentication = { + basic: registryAuthenticationBasic2, + gcpGcr: registryAuthenticationGcpGcr2, + awsEcr: registryAuthenticationAwsEcr2, + dockerHub: registryAuthenticationDockerHub2, + gcpGar: registryAuthenticationGcpGar2, + }; + + const updateContainer: UpdateContainer = { + image: 'cupidatat officia', + resources: resources, + command: ['command'], + priority: containerGroupPriority, + environmentVariables: [], + logging: updateContainerLogging, + registryAuthentication: updateContainerRegistryAuthentication, + }; + + const countryCode = CountryCode.AF; + + const updateContainerGroupNetworking: UpdateContainerGroupNetworking = { + port: 41663, + }; + + const containerGroupProbeTcp: ContainerGroupProbeTcp = { + port: 58492, + }; + + const containerProbeHttpScheme = ContainerProbeHttpScheme.HTTP; + + const containerGroupProbeHttpHeaders2: ContainerGroupProbeHttpHeaders2 = { + name: 'name', + value: 'value', + }; + + const containerGroupProbeHttp: ContainerGroupProbeHttp = { + path: 'path', + port: 10866, + scheme: containerProbeHttpScheme, + headers: [containerGroupProbeHttpHeaders2], + }; + + const containerGroupProbeGrpc: ContainerGroupProbeGrpc = { + service: 'service', + port: 43992, + }; + + const containerGroupProbeExec: ContainerGroupProbeExec = { + command: ['command'], + }; + + const containerGroupLivenessProbe: ContainerGroupLivenessProbe = { + tcp: containerGroupProbeTcp, + http: containerGroupProbeHttp, + grpc: containerGroupProbeGrpc, + exec: containerGroupProbeExec, + initialDelaySeconds: 9, + periodSeconds: 10, + timeoutSeconds: 30, + successThreshold: 1, + failureThreshold: 3, + }; + + const containerGroupReadinessProbe: ContainerGroupReadinessProbe = { + tcp: containerGroupProbeTcp, + http: containerGroupProbeHttp, + grpc: containerGroupProbeGrpc, + exec: containerGroupProbeExec, + initialDelaySeconds: 10, + periodSeconds: 1, + timeoutSeconds: 1, + successThreshold: 1, + failureThreshold: 3, + }; + + const containerGroupStartupProbe: ContainerGroupStartupProbe = { + tcp: containerGroupProbeTcp, + http: containerGroupProbeHttp, + grpc: containerGroupProbeGrpc, + exec: containerGroupProbeExec, + initialDelaySeconds: 1, + periodSeconds: 3, + timeoutSeconds: 10, + successThreshold: 2, + failureThreshold: 1200, + }; + + const updateContainerGroup: UpdateContainerGroup = { + displayName: 'tbkBzZA6', + container: updateContainer, + replicas: 37, + countryCodes: [countryCode], + networking: updateContainerGroupNetworking, + livenessProbe: containerGroupLivenessProbe, + readinessProbe: containerGroupReadinessProbe, + startupProbe: containerGroupStartupProbe, + }; + + const { data } = await saladCloudSdk.containerGroups.updateContainerGroup( + 'zt-dvmb-gmo5a', + 'enqsq6na2w8d2wlvk-85d3jxhjhj', + 'fcixv6oyiqlk', + input, + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-start-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-start-post.md new file mode 100644 index 0000000..df40aba --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-start-post.md @@ -0,0 +1,17 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.startContainerGroup( + 'sm3eup0iqixen33w3mp1ln15pix00azjaxgfnuon5rnc', + 'kyp6oi0404lk6h', + 'ucuerglkiabi4sbb23l56oq87j1v654hdchyg-8n5glaql3-539c', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-stop-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-stop-post.md new file mode 100644 index 0000000..d1579a2 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-containers-{container_group_name}-stop-post.md @@ -0,0 +1,17 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.containerGroups.stopContainerGroup( + 'tytntnk7-le269faihpgelqal6jc7327027puoxjag6lmdgb0c3qeelc', + 's1m84-o8x59', + 't96e3mcxix0izfrbhlu3evx', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-get.md new file mode 100644 index 0000000..59a6d28 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-get.md @@ -0,0 +1,16 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.queues.listQueues( + 'lwt38wqx9ycbbwq7cz7enua', + 'i5ohrcyvt0ap8jxyjtw5spbfh7ukelysoi13iija9co', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-post.md new file mode 100644 index 0000000..93f34c9 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-post.md @@ -0,0 +1,23 @@ +```typescript +import { CreateQueue, SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const createQueue: CreateQueue = { + name: 'ykm2ls08p3lv', + displayName: 'Av8HrM6.', + description: 'nulla enim', + }; + + const { data } = await saladCloudSdk.queues.createQueue( + 'lwt38wqx9ycbbwq7cz7enua', + 'i5ohrcyvt0ap8jxyjtw5spbfh7ukelysoi13iija9co', + input, + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-delete.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-delete.md new file mode 100644 index 0000000..ec2a86b --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-delete.md @@ -0,0 +1,17 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.queues.deleteQueue( + 'voe5nrfsnef63doc193sgdihl8bgcxw201b7qbn', + 'xlauk07eld4q4sm9jdgi4bgl1flz0elvw26099ougowft9j-kjp6bahz155', + 'gsomvfqk5h4gbc8o3p4id29bdadte3m51it2hfzxfmyjtvnd0b', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-get.md new file mode 100644 index 0000000..7e74a21 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-get.md @@ -0,0 +1,17 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.queues.getQueue( + 'voe5nrfsnef63doc193sgdihl8bgcxw201b7qbn', + 'xlauk07eld4q4sm9jdgi4bgl1flz0elvw26099ougowft9j-kjp6bahz155', + 'gsomvfqk5h4gbc8o3p4id29bdadte3m51it2hfzxfmyjtvnd0b', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-get.md new file mode 100644 index 0000000..b44a3e7 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-get.md @@ -0,0 +1,21 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.queues.listQueueJobs( + 'qiqiazzthr12lsqkk1iq35-ix3pzbff9-f8x8ls569n71', + 'ht3-tiei7j9ye5yzdixjzbx5ywjbd', + 'xp465rhqkyqstwpk8kd3jy5kakai4lollggq7i7xz97', + { + page: 1955049824, + pageSize: 95, + }, + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-post.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-post.md new file mode 100644 index 0000000..35aa4d7 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-post.md @@ -0,0 +1,24 @@ +```typescript +import { CreateQueueJob, SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const createQueueJob: CreateQueueJob = { + input: [], + metadata: {}, + webhook: 'webhook', + }; + + const { data } = await saladCloudSdk.queues.createQueueJob( + 'qiqiazzthr12lsqkk1iq35-ix3pzbff9-f8x8ls569n71', + 'ht3-tiei7j9ye5yzdixjzbx5ywjbd', + 'xp465rhqkyqstwpk8kd3jy5kakai4lollggq7i7xz97', + input, + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-delete.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-delete.md new file mode 100644 index 0000000..7359e40 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-delete.md @@ -0,0 +1,18 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.queues.deleteQueueJob( + 'erx15rey11qozndq25fyep9cx1pky-znnuxifqcep9-zc', + 'x9-4z-1rr438ze1lo349hdscooit-lme54jb98rdf4itla-wc6aace', + 'e-tvw-8ybw4mj2a', + 'queue_job_id', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-get.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-get.md new file mode 100644 index 0000000..064dd15 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-jobs-{queue_job_id}-get.md @@ -0,0 +1,18 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.queues.getQueueJob( + 'erx15rey11qozndq25fyep9cx1pky-znnuxifqcep9-zc', + 'x9-4z-1rr438ze1lo349hdscooit-lme54jb98rdf4itla-wc6aace', + 'e-tvw-8ybw4mj2a', + 'queue_job_id', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-patch.md b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-patch.md new file mode 100644 index 0000000..8b2949b --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-projects-{project_name}-queues-{queue_name}-patch.md @@ -0,0 +1,23 @@ +```typescript +import { SaladCloudSdk, UpdateQueue } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const updateQueue: UpdateQueue = { + displayName: 'X3iu1Xk', + description: 'ullamco consequat voluptate', + }; + + const { data } = await saladCloudSdk.queues.updateQueue( + 'voe5nrfsnef63doc193sgdihl8bgcxw201b7qbn', + 'xlauk07eld4q4sm9jdgi4bgl1flz0elvw26099ougowft9j-kjp6bahz155', + 'gsomvfqk5h4gbc8o3p4id29bdadte3m51it2hfzxfmyjtvnd0b', + input, + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-quotas-get.md b/documentation/snippets/organizations-{organization_name}-quotas-get.md new file mode 100644 index 0000000..af5b699 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-quotas-get.md @@ -0,0 +1,13 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.quotas.getQuotas('y-7yhh5v70xusg163gdfs9vma6wkyd2rcvosdiwny-k'); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-webhook-secret-key-get.md b/documentation/snippets/organizations-{organization_name}-webhook-secret-key-get.md new file mode 100644 index 0000000..d38eea0 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-webhook-secret-key-get.md @@ -0,0 +1,15 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.webhookSecretKey.getWebhookSecretKey( + 'hn9h7px3wro2wjja0yeu6kcgk0nggtveqmh45ilbsw4b2dcch55e1sj', + ); + + console.log(data); +})(); +``` diff --git a/documentation/snippets/organizations-{organization_name}-webhook-secret-key-post.md b/documentation/snippets/organizations-{organization_name}-webhook-secret-key-post.md new file mode 100644 index 0000000..a451ea0 --- /dev/null +++ b/documentation/snippets/organizations-{organization_name}-webhook-secret-key-post.md @@ -0,0 +1,15 @@ +```typescript +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.webhookSecretKey.updateWebhookSecretKey( + 'hn9h7px3wro2wjja0yeu6kcgk0nggtveqmh45ilbsw4b2dcch55e1sj', + ); + + console.log(data); +})(); +``` diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..047a96d --- /dev/null +++ b/examples/README.md @@ -0,0 +1,27 @@ +# @saladtechnologies-oss/salad-cloud-sdk + +A basic example of how to use the @saladtechnologies-oss/salad-cloud-sdk package. + +## Installation + +In the event `@saladtechnologies-oss/salad-cloud-sdk` is not published to npm, you can install it locally by running the following command in the examples folder: + +```sh +npm run setup +``` + +This will rebuild the parent package and install it locally. + +Otherwise you can install it from npm: + +```sh +npm install @saladtechnologies-oss/salad-cloud-sdk +``` + +## Usage + +To run the example, run the following command in the examples folder: + +```sh +npm run start +``` diff --git a/examples/package.json b/examples/package.json new file mode 100644 index 0000000..5facdfa --- /dev/null +++ b/examples/package.json @@ -0,0 +1,18 @@ +{ + "name": "salad-cloud-sdk", + "version": "0.9.0-alpha.1", + "private": true, + "dependencies": { + "@saladtechnologies-oss/salad-cloud-sdk": "file:../", + "zod": "3.22.0" + }, + "scripts": { + "setup": "npm --prefix ../ install && npm --prefix ../ run build && npm install", + "start": "tsc && node dist/index.js", + "dev": "ts-node src/index.ts" + }, + "devDependencies": { + "ts-node": "^10.9.1", + "typescript": "5.3.3" + } +} diff --git a/examples/src/index.ts b/examples/src/index.ts new file mode 100644 index 0000000..3cd13ae --- /dev/null +++ b/examples/src/index.ts @@ -0,0 +1,11 @@ +import { SaladCloudSdk } from '@saladtechnologies-oss/salad-cloud-sdk'; + +(async () => { + const saladCloudSdk = new SaladCloudSdk({ + apiKey: 'YOUR_API_KEY', + }); + + const { data } = await saladCloudSdk.quotas.getQuotas('y-7yhh5v70xusg163gdfs9vma6wkyd2rcvosdiwny-k'); + + console.log(data); +})(); diff --git a/examples/tsconfig.json b/examples/tsconfig.json new file mode 100644 index 0000000..78eb691 --- /dev/null +++ b/examples/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "es2018", + "module": "Node16", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "outDir": "./dist", + "rootDir": "./src", + "noImplicitAny": true, + "baseUrl": "./", + "declaration": true, + "moduleResolution": "Node16", + "isolatedModules": true, + "allowSyntheticDefaultImports": true, + "declarationMap": true, + "lib": ["es2017", "dom"], + "sourceMap": true + }, + "include": ["src/"] +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..72a12eb --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1936 @@ +{ + "name": "@saladtechnologies-oss/salad-cloud-sdk", + "version": "0.9.0-alpha.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@saladtechnologies-oss/salad-cloud-sdk", + "version": "0.9.0-alpha.1", + "license": "MIT", + "dependencies": { + "zod": "3.22.0" + }, + "devDependencies": { + "tsup": "^6.7.0", + "typescript": "5.3.3" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", + "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", + "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", + "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", + "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", + "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", + "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", + "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", + "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", + "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", + "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", + "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", + "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", + "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", + "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", + "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", + "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", + "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", + "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", + "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", + "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", + "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", + "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bundle-require": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-4.2.1.tgz", + "integrity": "sha512-7Q/6vkyYAwOmQNRw75x+4yRtZCZJXUDmHHlFdkiV0wgv/reNjtJwpu1jPJ0w2kbEpIM0uoKI3S4/f39dU7AjSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "load-tsconfig": "^0.2.3" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "esbuild": ">=0.17" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", + "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.17.19", + "@esbuild/android-arm64": "0.17.19", + "@esbuild/android-x64": "0.17.19", + "@esbuild/darwin-arm64": "0.17.19", + "@esbuild/darwin-x64": "0.17.19", + "@esbuild/freebsd-arm64": "0.17.19", + "@esbuild/freebsd-x64": "0.17.19", + "@esbuild/linux-arm": "0.17.19", + "@esbuild/linux-arm64": "0.17.19", + "@esbuild/linux-ia32": "0.17.19", + "@esbuild/linux-loong64": "0.17.19", + "@esbuild/linux-mips64el": "0.17.19", + "@esbuild/linux-ppc64": "0.17.19", + "@esbuild/linux-riscv64": "0.17.19", + "@esbuild/linux-s390x": "0.17.19", + "@esbuild/linux-x64": "0.17.19", + "@esbuild/netbsd-x64": "0.17.19", + "@esbuild/openbsd-x64": "0.17.19", + "@esbuild/sunos-x64": "0.17.19", + "@esbuild/win32-arm64": "0.17.19", + "@esbuild/win32-ia32": "0.17.19", + "@esbuild/win32-x64": "0.17.19" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/joycon": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", + "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/load-tsconfig": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", + "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", + "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss-load-config": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-3.1.4.tgz", + "integrity": "sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "lilconfig": "^2.0.5", + "yaml": "^1.10.2" + }, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "3.29.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", + "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", + "dev": true, + "license": "MIT", + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=14.18.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.8.0-beta.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", + "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "whatwg-url": "^7.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/sucrase": { + "version": "3.35.0", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", + "integrity": "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "glob": "^10.3.10", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/tsup": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/tsup/-/tsup-6.7.0.tgz", + "integrity": "sha512-L3o8hGkaHnu5TdJns+mCqFsDBo83bJ44rlK7e6VdanIvpea4ArPcU3swWGsLVbXak1PqQx/V+SSmFPujBK+zEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bundle-require": "^4.0.0", + "cac": "^6.7.12", + "chokidar": "^3.5.1", + "debug": "^4.3.1", + "esbuild": "^0.17.6", + "execa": "^5.0.0", + "globby": "^11.0.3", + "joycon": "^3.0.1", + "postcss-load-config": "^3.0.1", + "resolve-from": "^5.0.0", + "rollup": "^3.2.5", + "source-map": "0.8.0-beta.0", + "sucrase": "^3.20.3", + "tree-kill": "^1.2.2" + }, + "bin": { + "tsup": "dist/cli-default.js", + "tsup-node": "dist/cli-node.js" + }, + "engines": { + "node": ">=14.18" + }, + "peerDependencies": { + "@swc/core": "^1", + "postcss": "^8.4.12", + "typescript": ">=4.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "postcss": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 6" + } + }, + "node_modules/zod": { + "version": "3.22.0", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.0.tgz", + "integrity": "sha512-y5KZY/ssf5n7hCGDGGtcJO/EBJEm5Pa+QQvFBeyMOtnFYOSflalxIFFvdaYevPhePcmcKC4aTbFkCcXN7D0O8Q==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..3e89ca1 --- /dev/null +++ b/package.json @@ -0,0 +1,43 @@ +{ + "name": "@saladtechnologies-oss/salad-cloud-sdk", + "version": "0.9.0-alpha.1", + "description": "The SaladCloud REST API. Please refer to the [SaladCloud API Documentation](https://docs.salad.com/api-reference) for more details.", + "source": "./src/index.ts", + "main": "./dist/commonjs/index.js", + "module": "./dist/esm/index.js", + "browser": "./dist/index.umd.js", + "unpkg": "./dist/index.umd.js", + "types": "./dist/commonjs/index.d.ts", + "scripts": { + "test": "tsc --noEmit", + "build": "tsup-node src/index.ts --format cjs,esm --dts --clean", + "prepublishOnly": "npm run build" + }, + "keywords": [ + "typescript", + "sdk", + "api", + "client" + ], + "files": [ + "dist", + "README.md" + ], + "author": "SaladCloud Support", + "homepage": "https://github.com/saladtechnologies/salad-cloud-sdk-javascript", + "license": "MIT", + "devDependencies": { + "typescript": "5.3.3", + "tsup": "^6.7.0" + }, + "dependencies": { + "zod": "3.22.0" + }, + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/index.js", + "types": "./dist/index.d.ts" + } + } +} diff --git a/src/http/client.ts b/src/http/client.ts new file mode 100644 index 0000000..d4b0efc --- /dev/null +++ b/src/http/client.ts @@ -0,0 +1,39 @@ +import { SerializationStyle } from './serialization/base-serializer'; +import { HttpMethod, HttpResponse, Options, RetryOptions, SdkConfig } from './types'; +import { RequestHandlerChain } from './handlers/handler-chain'; +import { HookHandler } from './handlers/hook-handler'; +import { ResponseValidationHandler } from './handlers/response-validation-handler'; +import { RequestValidationHandler } from './handlers/request-validation-handler'; +import { CustomHook } from './hooks/custom-hook'; +import { TerminatingHandler } from './handlers/terminating-handler'; +import { RetryHandler } from './handlers/retry-handler'; +import { Request } from './transport/request'; +import { AuthHandler } from './handlers/auth-handler'; + +export class HttpClient { + private readonly requestHandlerChain = new RequestHandlerChain(); + + constructor( + private config: SdkConfig, + hook = new CustomHook(), + ) { + this.requestHandlerChain.addHandler(new ResponseValidationHandler()); + this.requestHandlerChain.addHandler(new RequestValidationHandler()); + this.requestHandlerChain.addHandler(new AuthHandler()); + this.requestHandlerChain.addHandler(new RetryHandler()); + this.requestHandlerChain.addHandler(new HookHandler(hook)); + this.requestHandlerChain.addHandler(new TerminatingHandler()); + } + + call(request: Request): Promise> { + return this.requestHandlerChain.callChain(request); + } + + setBaseUrl(url: string): void { + this.config.baseUrl = url; + } + + setConfig(config: SdkConfig): void { + this.config = config; + } +} diff --git a/src/http/environment.ts b/src/http/environment.ts new file mode 100644 index 0000000..4326b56 --- /dev/null +++ b/src/http/environment.ts @@ -0,0 +1,3 @@ +export enum Environment { + DEFAULT = 'https://api.salad.com/api/public', +} diff --git a/src/http/error.ts b/src/http/error.ts new file mode 100644 index 0000000..4dc1d6b --- /dev/null +++ b/src/http/error.ts @@ -0,0 +1,12 @@ +import { HttpMetadata } from './types'; + +export class HttpError extends Error { + public readonly error: string; + public readonly metadata: HttpMetadata; + + constructor(metadata: HttpMetadata, error?: string) { + super(error); + this.error = metadata.statusText; + this.metadata = metadata; + } +} diff --git a/src/http/handlers/auth-handler.ts b/src/http/handlers/auth-handler.ts new file mode 100644 index 0000000..06f6be0 --- /dev/null +++ b/src/http/handlers/auth-handler.ts @@ -0,0 +1,35 @@ +import { Request } from '../transport/request'; +import { HttpResponse, RequestHandler } from '../types'; +import { SerializationStyle } from '../serialization/base-serializer'; + +export class AuthHandler implements RequestHandler { + next?: RequestHandler; + + async handle(request: Request): Promise> { + const requestWithAuth = this.addApiKeyHeader(request); + + if (!this.next) { + throw new Error(`No next handler set in ${AuthHandler.name}`); + } + + return this.next?.handle(requestWithAuth); + } + + private addApiKeyHeader(request: Request): Request { + const apiKey = request.config?.apiKey; + const apiKeyHeader = request.config?.apiKeyHeader ?? 'Salad-Api-Key'; + if (!apiKey) { + return request; + } + + request.addHeaderParam(apiKeyHeader, { + key: apiKeyHeader, + value: apiKey, + explode: false, + encode: false, + style: SerializationStyle.SIMPLE, + }); + + return request; + } +} diff --git a/src/http/handlers/handler-chain.ts b/src/http/handlers/handler-chain.ts new file mode 100644 index 0000000..9f56b04 --- /dev/null +++ b/src/http/handlers/handler-chain.ts @@ -0,0 +1,22 @@ +import { Request } from '../transport/request'; +import { HttpResponse, RequestHandler } from '../types'; + +export class RequestHandlerChain { + private readonly handlers: RequestHandler[] = []; + + addHandler(handler: RequestHandler): void { + if (this.handlers.length > 0) { + const previousHandler = this.handlers[this.handlers.length - 1]; + previousHandler.next = handler; + } + this.handlers.push(handler); + } + + async callChain(request: Request): Promise> { + if (!this.handlers.length) { + throw new Error('No handlers added to the chain'); + } + + return this.handlers[0].handle(request); + } +} diff --git a/src/http/handlers/hook-handler.ts b/src/http/handlers/hook-handler.ts new file mode 100644 index 0000000..5638d3a --- /dev/null +++ b/src/http/handlers/hook-handler.ts @@ -0,0 +1,38 @@ +import { Request } from '../transport/request'; +import { HttpResponse, RequestHandler } from '../types'; +import { HttpError } from '../error'; +import { Hook } from '../hooks/hook'; +import { TransportHookAdapter } from '../transport/transport-hook-adapter'; + +export class HookHandler implements RequestHandler { + next?: RequestHandler; + + constructor(private readonly hook: Hook) {} + + async handle(request: Request): Promise> { + if (!this.next) { + throw new Error('No next handler set in hook handler.'); + } + + const hook = new TransportHookAdapter(); + + const hookParams = this.getHookParams(request); + + const nextRequest = await hook.beforeRequest(request, hookParams); + + const response = await this.next.handle(nextRequest); + + if (response.metadata.status < 400) { + return await hook.afterResponse(nextRequest, response, hookParams); + } + + const error = await hook.onError(nextRequest, response, hookParams); + + throw new HttpError(error.metadata, error.error); + } + + private getHookParams(_request: Request): Map { + const hookParams: Map = new Map(); + return hookParams; + } +} diff --git a/src/http/handlers/request-validation-handler.ts b/src/http/handlers/request-validation-handler.ts new file mode 100644 index 0000000..86f84fe --- /dev/null +++ b/src/http/handlers/request-validation-handler.ts @@ -0,0 +1,72 @@ +import { Request } from '../transport/request'; +import { ContentType, HttpResponse, RequestHandler } from '../types'; +import { HttpError } from '../error'; + +export class RequestValidationHandler implements RequestHandler { + next?: RequestHandler; + + async handle(request: Request): Promise> { + if (!this.next) { + throw new Error('No next handler set in ContentTypeHandler.'); + } + + if (request.requestContentType === ContentType.Json) { + request.body = JSON.stringify(request.requestSchema?.parse(request.body)); + } else if ( + request.requestContentType === ContentType.Xml || + request.requestContentType === ContentType.Binary || + request.requestContentType === ContentType.Text + ) { + request.body = request.body; + } else if (request.requestContentType === ContentType.FormUrlEncoded) { + request.body = this.toFormUrlEncoded(request.body); + } else if (request.requestContentType === ContentType.MultipartFormData) { + request.body = this.toFormData(request.body); + } else { + request.body = JSON.stringify(request.requestSchema?.parse(request.body)); + } + + return await this.next.handle(request); + } + + toFormUrlEncoded(body: BodyInit | undefined): string { + if (body === undefined) { + return ''; + } + + if (typeof body === 'string') { + return body; + } + + if (body instanceof URLSearchParams) { + return body.toString(); + } + + if (body instanceof FormData) { + const params = new URLSearchParams(); + body.forEach((value, key) => { + params.append(key, value.toString()); + }); + return params.toString(); + } + + return ''; + } + + toFormData(body: Record): FormData | undefined { + const formData = new FormData(); + + Object.keys(body).forEach((key: any) => { + const value: any = body[key]; + if (Array.isArray(value)) { + value.forEach((v, i) => formData.append(`${key}[${i}]`, v)); + } else if (value instanceof ArrayBuffer) { + formData.append(key, new Blob([value])); + } else { + formData.append(key, value); + } + }); + + return formData; + } +} diff --git a/src/http/handlers/response-validation-handler.ts b/src/http/handlers/response-validation-handler.ts new file mode 100644 index 0000000..779c5f1 --- /dev/null +++ b/src/http/handlers/response-validation-handler.ts @@ -0,0 +1,106 @@ +import { Request } from '../transport/request'; +import { ZodUndefined } from 'zod'; +import { ContentType, HttpResponse, RequestHandler } from '../types'; +import { HttpError } from '../error'; + +export class ResponseValidationHandler implements RequestHandler { + next?: RequestHandler; + + async handle(request: Request): Promise> { + const response = await this.next!.handle(request); + + if (!this.hasContent(request, response)) { + return response; + } + + if (request.responseContentType === ContentType.Json) { + const decodedBody = new TextDecoder().decode(response.raw); + const json = JSON.parse(decodedBody); + return { + ...response, + data: this.validate(request, json), + }; + } else if ( + request.responseContentType === ContentType.Binary || + request.responseContentType === ContentType.Image + ) { + return { + ...response, + data: this.validate(request, response.raw), + }; + } else if (request.responseContentType === ContentType.Text || request.responseContentType === ContentType.Xml) { + const text = new TextDecoder().decode(response.raw); + return { + ...response, + data: this.validate(request, text), + }; + } else if (request.responseContentType === ContentType.FormUrlEncoded) { + const urlEncoded = this.fromUrlEncoded(new TextDecoder().decode(response.raw)); + return { + ...response, + data: this.validate(request, urlEncoded), + }; + } else if (request.responseContentType === ContentType.MultipartFormData) { + const formData = this.fromFormData(response.raw); + return { + ...response, + data: this.validate(request, formData), + }; + } else { + const decodedBody = new TextDecoder().decode(response.raw); + const json = JSON.parse(decodedBody); + return { + ...response, + data: this.validate(request, json), + }; + } + } + + private validate(request: Request, data: any): T { + if (request.validation?.responseValidation) { + return request.responseSchema.parse(data); + } + return data; + } + + private hasContent(request: Request, response: HttpResponse): boolean { + return ( + !!request.responseSchema && !(request.responseSchema instanceof ZodUndefined) && response.metadata.status !== 204 + ); + } + + private fromUrlEncoded(urlEncodedData: string): object { + const pairs = urlEncodedData.split('&'); + const result: Record = {}; + + pairs.forEach((pair) => { + const [key, value] = pair.split('='); + if (key && value !== undefined) { + result[decodeURIComponent(key)] = decodeURIComponent(value); + } + }); + + return result; + } + + private fromFormData(arrayBuffer: ArrayBuffer): Record { + const decoder = new TextDecoder(); + const text = decoder.decode(arrayBuffer); + + const boundary = text.split('\r\n')[0]; + const parts = text.split(boundary).slice(1, -1); + + const formDataObj: Record = {}; + + parts.forEach((part) => { + const [header, value] = part.split('\r\n\r\n'); + const nameMatch = header.match(/name="([^"]+)"/); + if (nameMatch) { + const name = nameMatch[1].trim(); + formDataObj[name] = value?.trim() || ''; + } + }); + + return formDataObj; + } +} diff --git a/src/http/handlers/retry-handler.ts b/src/http/handlers/retry-handler.ts new file mode 100644 index 0000000..97bb8c7 --- /dev/null +++ b/src/http/handlers/retry-handler.ts @@ -0,0 +1,40 @@ +import { Request } from '../transport/request'; +import { HttpResponse, RequestHandler } from '../types'; +import { HttpError } from '../error'; + +export class RetryHandler implements RequestHandler { + next?: RequestHandler; + + async handle(request: Request): Promise> { + if (!this.next) { + throw new Error('No next handler set in retry handler.'); + } + + for (let attempt = 1; attempt <= request.retry.attempts; attempt++) { + try { + return await this.next.handle(request); + } catch (error: any) { + if (!this.shouldRetry(error) || attempt === request.retry.attempts) { + throw error; + } + await this.delay(request.retry.delayMs); + } + } + + throw new Error('Error retrying request.'); + } + + private shouldRetry(error: Error): boolean { + return error instanceof HttpError && (error.metadata.status >= 500 || error.metadata.status === 408); + } + + private delay(delayMs: number | undefined): Promise { + if (!delayMs) { + return Promise.resolve(); + } + + return new Promise((resolve, reject) => { + setTimeout(() => resolve(), delayMs); + }); + } +} diff --git a/src/http/handlers/terminating-handler.ts b/src/http/handlers/terminating-handler.ts new file mode 100644 index 0000000..f7b90dd --- /dev/null +++ b/src/http/handlers/terminating-handler.ts @@ -0,0 +1,10 @@ +import { HttpError } from '../error'; +import { Request } from '../transport/request'; +import { HttpResponse, RequestHandler } from '../types'; +import { RequestFetchAdapter } from '../transport/request-fetch-adapter'; + +export class TerminatingHandler implements RequestHandler { + async handle(request: Request): Promise> { + return new RequestFetchAdapter(request).send(); + } +} diff --git a/src/http/hooks/custom-hook.ts b/src/http/hooks/custom-hook.ts new file mode 100644 index 0000000..c4dcf51 --- /dev/null +++ b/src/http/hooks/custom-hook.ts @@ -0,0 +1,32 @@ +import { HttpMetadata } from '../types'; +import { Hook } from './hook'; +import { HttpRequest, HttpResponse, HttpError } from './hook'; + +export class CustomHook implements Hook { + public async beforeRequest(request: HttpRequest, params: Map): Promise { + return request; + } + + public async afterResponse( + request: HttpRequest, + response: HttpResponse, + params: Map, + ): Promise> { + return response; + } + + public async onError( + request: HttpRequest, + response: HttpResponse, + params: Map, + ): Promise { + return new CustomHttpError('a custom error message', response.metadata); + } +} + +class CustomHttpError implements HttpError { + constructor( + public error: string, + public metadata: HttpMetadata, + ) {} +} diff --git a/src/http/hooks/hook.ts b/src/http/hooks/hook.ts new file mode 100644 index 0000000..9ca2433 --- /dev/null +++ b/src/http/hooks/hook.ts @@ -0,0 +1,40 @@ +type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; + +export interface HttpRequest { + baseUrl: string; + method: HttpMethod; + path: string; + headers: Map; + body?: BodyInit; + abortSignal?: AbortSignal; + queryParams: Map; +} + +interface HttpMetadata { + status: number; + statusText: string; + headers: Record; +} + +export interface HttpResponse { + data?: T; + metadata: HttpMetadata; + raw: ArrayBuffer; +} + +export interface HttpError { + error: string; + metadata: HttpMetadata; +} + +export interface Hook { + beforeRequest(request: HttpRequest, params: Map): Promise; + + afterResponse( + request: HttpRequest, + response: HttpResponse, + params: Map, + ): Promise>; + + onError(request: HttpRequest, response: HttpResponse, params: Map): Promise; +} diff --git a/src/http/index.ts b/src/http/index.ts new file mode 100644 index 0000000..84ea249 --- /dev/null +++ b/src/http/index.ts @@ -0,0 +1 @@ +export type { SdkConfig, RequestConfig, RetryOptions, ValidationOptions } from './types.ts'; diff --git a/src/http/serialization/base-serializer.ts b/src/http/serialization/base-serializer.ts new file mode 100644 index 0000000..7d0c782 --- /dev/null +++ b/src/http/serialization/base-serializer.ts @@ -0,0 +1,139 @@ +import { RequestParameter } from '../transport/request'; + +export type SerializationOptions = { + explode: boolean; + style: SerializationStyle; + encode: boolean; +}; + +export enum SerializationStyle { + SIMPLE = 'simple', + LABEL = 'label', + MATRIX = 'matrix', + FORM = 'form', + SPACE_DELIMITED = 'space_delimited', + PIPE_DELIMITED = 'pipe_delimited', + DEEP_OBJECT = 'deep_object', + NONE = 'none', +} + +export class Serializer { + protected serializeValue(param: RequestParameter): string { + if (Array.isArray(param.value)) { + return this.serializeArray(param.value, param); + } + + if (this.isNonNullObject(param.value)) { + return this.serializeObject(param.value, param); + } + + return this.serializePrimitive(param); + } + + private serializePrimitive(param: RequestParameter): string { + if (param.style === SerializationStyle.LABEL) { + return `.${param.value}`; + } else if (param.style === SerializationStyle.MATRIX) { + return `;${param.key}=${param.value}`; + } else if (param.style === SerializationStyle.FORM) { + return `${encodeURIComponent(param.key || '')}=${encodeURIComponent(`${param.value}`)}`; + } + + return `${param.value}`; + } + + private serializeArray(value: unknown[], param: RequestParameter): string { + if (param.explode) { + this.serializeArrayExploded(value, param); + return this.serializeArrayExploded(value, param); + } + + if (param.style === SerializationStyle.SIMPLE) { + return `${value.join(',')}`; + } else if (param.style === SerializationStyle.LABEL) { + return `.${value.join(',')}`; + } else if (param.style === SerializationStyle.MATRIX) { + return `;${param.key}=${value.join(',')}`; + } else if (param.style === SerializationStyle.FORM) { + return `${encodeURIComponent(param.key || '')}=${encodeURIComponent(value.join(','))}`; + } else if (param.style === SerializationStyle.SPACE_DELIMITED) { + return `${param.key}=${value.join(' ')}`; + } else if (param.style === SerializationStyle.PIPE_DELIMITED) { + return `${param.key}=${value.join('|')}`; + } + + return `${value.join(',')}`; + } + + private serializeArrayExploded(value: unknown[], param: RequestParameter): string { + if (param.style === SerializationStyle.SIMPLE) { + return value.map((val) => `${val}`).join(','); + } else if (param.style === SerializationStyle.LABEL) { + return value.map((val) => `.${val}`).join(''); + } else if (param.style === SerializationStyle.MATRIX) { + return value.map((val) => `;${param.key}=${val}`).join(''); + } else if ( + param.style === SerializationStyle.FORM || + param.style === SerializationStyle.SPACE_DELIMITED || + param.style === SerializationStyle.PIPE_DELIMITED + ) { + return value.map((val) => `${encodeURIComponent(param.key || '')}=${encodeURIComponent(`${val}`)}`).join('&'); + } + + return `${value.join(',')}`; + } + + private serializeObject(obj: object, param: RequestParameter): string { + if (param.explode) { + if (param.style === SerializationStyle.SIMPLE) { + return Object.entries(obj) + .map(([key, val]) => `${key}=${val}`) + .join(','); + } else if (param.style === SerializationStyle.LABEL) { + return Object.entries(obj) + .map(([key, val]) => `.${key}=${val}`) + .join(''); + } else if (param.style === SerializationStyle.MATRIX) { + return Object.entries(obj) + .map(([key, val]) => `;${key}=${val}`) + .join(''); + } else if (param.style === SerializationStyle.FORM) { + return Object.entries(obj) + .map(([key, val]) => `${key}=${val}`) + .join('&'); + } + } + + if (param.style === SerializationStyle.SIMPLE) { + return Object.entries(obj) + .map(([key, val]) => `${key},${val}`) + .join(','); + } else if (param.style === SerializationStyle.LABEL) { + return `.${Object.entries(obj) + .map(([key, val]) => `${key},${val}`) + .join(',')}`; + } else if (param.style === SerializationStyle.MATRIX) { + return `;${param.key}=${Object.entries(obj) + .map(([key, val]) => `${key},${val}`) + .join(',')}`; + } else if (param.style === SerializationStyle.FORM) { + return Object.entries(obj) + .map(([key, val]) => `${key}=${val}`) + .join('&'); + } else if (param.style === SerializationStyle.DEEP_OBJECT) { + return Object.entries(obj) + .map(([key, val]) => { + return `${param.key}[${key}]=${val}`; + }) + .join('&'); + } + + return Object.entries(obj) + .map(([key, val]) => `${key}=${val}`) + .join('&'); + } + + private isNonNullObject(value: unknown): value is object { + return typeof value === 'object' && value !== null; + } +} diff --git a/src/http/serialization/header-serializer.ts b/src/http/serialization/header-serializer.ts new file mode 100644 index 0000000..98f2fae --- /dev/null +++ b/src/http/serialization/header-serializer.ts @@ -0,0 +1,19 @@ +import { RequestParameter } from '../transport/request'; +import { Serializer } from './base-serializer'; + +export class HeaderSerializer extends Serializer { + public serialize(headerParams: Map | undefined): HeadersInit | undefined { + if (!headerParams || !headerParams.size) { + return undefined; + } + + const headers: HeadersInit = {}; + headerParams.forEach((param) => { + if (!param.key) { + return; + } + headers[param.key] = this.serializeValue(param); + }); + return headers; + } +} diff --git a/src/http/serialization/path-serializer.ts b/src/http/serialization/path-serializer.ts new file mode 100644 index 0000000..000fa9d --- /dev/null +++ b/src/http/serialization/path-serializer.ts @@ -0,0 +1,12 @@ +import { RequestParameter } from '../transport/request'; +import { Serializer } from './base-serializer'; + +export class PathSerializer extends Serializer { + public serialize(pathPattern: string, pathArguments: Map): string { + let serializedPath = pathPattern; + pathArguments.forEach((param: RequestParameter) => { + serializedPath = serializedPath.replace(`{${param.key}}`, `${this.serializeValue(param)}`); + }); + return serializedPath; + } +} diff --git a/src/http/serialization/query-serializer.ts b/src/http/serialization/query-serializer.ts new file mode 100644 index 0000000..88dd679 --- /dev/null +++ b/src/http/serialization/query-serializer.ts @@ -0,0 +1,18 @@ +import { RequestParameter } from '../transport/request'; +import { SerializationOptions, Serializer } from './base-serializer'; + +export class QuerySerializer extends Serializer { + public serialize(queryParams: Map): string { + if (!queryParams || !queryParams.size) { + return ''; + } + + const query: string[] = []; + + queryParams.forEach((param) => { + return query.push(`${this.serializeValue(param)}`); + }); + + return query.length ? `?${query.join('&')}` : ''; + } +} diff --git a/src/http/transport/request-builder.ts b/src/http/transport/request-builder.ts new file mode 100644 index 0000000..a860fdd --- /dev/null +++ b/src/http/transport/request-builder.ts @@ -0,0 +1,164 @@ +import z, { ZodType } from 'zod'; +import { Request, CreateRequestParameters, RequestParameter } from './request'; +import { ContentType, HttpMethod, SdkConfig, RequestConfig, RetryOptions, ValidationOptions } from '../types'; +import { Environment } from '../environment'; +import { SerializationStyle } from '../serialization/base-serializer'; + +export class RequestBuilder { + private params: CreateRequestParameters; + + constructor() { + this.params = { + baseUrl: Environment.DEFAULT, + method: 'GET', + path: '', + config: {}, + responseSchema: z.any(), + requestSchema: z.any(), + requestContentType: ContentType.Json, + responseContentType: ContentType.Json, + retry: { + attempts: 3, + delayMs: 150, + }, + validation: { + responseValidation: true, + }, + pathParams: new Map(), + queryParams: new Map(), + headers: new Map(), + }; + } + + setRetryAttempts(sdkConfig?: SdkConfig, requestConfig?: RequestConfig): RequestBuilder { + if (requestConfig?.retry?.attempts !== undefined) { + this.params.retry.attempts = requestConfig.retry.attempts; + } else if (sdkConfig?.retry?.attempts !== undefined) { + this.params.retry.attempts = sdkConfig.retry.attempts; + } + + return this; + } + + setRetryDelayMs(sdkConfig?: SdkConfig, requestConfig?: RequestConfig): RequestBuilder { + if (requestConfig?.retry?.delayMs !== undefined) { + this.params.retry.delayMs = requestConfig.retry.delayMs; + } else if (sdkConfig?.retry?.delayMs !== undefined) { + this.params.retry.delayMs = sdkConfig.retry.delayMs; + } + + return this; + } + + setResponseValidation(sdkConfig: SdkConfig, requestConfig?: RequestConfig): RequestBuilder { + if (requestConfig?.validation?.responseValidation !== undefined) { + this.params.validation.responseValidation = requestConfig.validation.responseValidation; + } else if (sdkConfig?.validation?.responseValidation !== undefined) { + this.params.validation.responseValidation = sdkConfig.validation.responseValidation; + } + + return this; + } + + setBaseUrl(sdkConfig: SdkConfig): RequestBuilder { + if (sdkConfig?.baseUrl !== undefined) { + this.params.baseUrl = sdkConfig.baseUrl; + } + + return this; + } + + setMethod(method: HttpMethod): RequestBuilder { + this.params.method = method; + return this; + } + + setPath(path: string): RequestBuilder { + this.params.path = path; + return this; + } + + setConfig(config: SdkConfig): RequestBuilder { + this.params.config = config; + return this; + } + + setRequestContentType(contentType: ContentType): RequestBuilder { + this.params.requestContentType = contentType; + return this; + } + + setResponseContentType(contentType: ContentType): RequestBuilder { + this.params.responseContentType = contentType; + return this; + } + + setRequestSchema(requestSchema: ZodType): RequestBuilder { + this.params.requestSchema = requestSchema; + return this; + } + + setResponseSchema(responseSchema: ZodType): RequestBuilder { + this.params.responseSchema = responseSchema; + return this; + } + + addBody(body?: any): RequestBuilder { + if (body !== undefined) { + this.params.body = body; + } + return this; + } + + addPathParam(param: Partial): RequestBuilder { + if (param.value === undefined || param.key === undefined) { + return this; + } + + this.params.pathParams.set(param.key, { + key: param.key, + value: param.value, + explode: param.explode ?? true, + style: param.style ?? SerializationStyle.SIMPLE, + encode: param.encode ?? true, + }); + + return this; + } + + addQueryParam(param: Partial): RequestBuilder { + if (param.value === undefined || param.key === undefined) { + return this; + } + + this.params.queryParams.set(param.key, { + key: param.key, + value: param.value, + explode: param.explode ?? true, + style: param.style ?? SerializationStyle.FORM, + encode: param.encode ?? true, + }); + + return this; + } + + addHeaderParam(param: Partial): RequestBuilder { + if (param.value === undefined || param.key === undefined) { + return this; + } + + this.params.headers.set(param.key, { + key: param.key, + value: param.value, + explode: param.explode ?? true, + style: param.style ?? SerializationStyle.SIMPLE, + encode: param.encode ?? false, + }); + + return this; + } + + public build(): Request { + return new Request(this.params); + } +} diff --git a/src/http/transport/request-fetch-adapter.ts b/src/http/transport/request-fetch-adapter.ts new file mode 100644 index 0000000..dd248cd --- /dev/null +++ b/src/http/transport/request-fetch-adapter.ts @@ -0,0 +1,88 @@ +import { HttpMethod, HttpResponse } from '../types'; +import { HttpError } from '../error'; +import { Request } from './request'; + +interface HttpAdapter { + send(): Promise; +} + +export class RequestFetchAdapter implements HttpAdapter { + private requestInit: RequestInit = {}; + + constructor(private request: Request) { + this.setMethod(request.method); + this.setHeaders(request.getHeaders()); + this.setBody(request.body); + this.setTimeout(request.config.timeout); + } + + public async send(): Promise> { + const response = await fetch(this.request.constructFullUrl(), this.requestInit); + + const metadata = { + status: response.status, + statusText: response.statusText || '', + headers: this.getHeaders(response), + }; + + if (metadata.status >= 400) { + throw new HttpError(metadata); + } + + return { + metadata, + raw: await response.clone().arrayBuffer(), + }; + } + + private setMethod(method: HttpMethod) { + if (!method) { + return; + } + this.requestInit = { + ...this.requestInit, + method, + }; + } + + private setBody(body: ReadableStream | null) { + if (!body) { + return; + } + this.requestInit = { + ...this.requestInit, + body, + }; + } + + private setHeaders(headers: HeadersInit | undefined) { + if (!headers) { + return; + } + + this.requestInit = { + ...this.requestInit, + headers, + }; + } + + private setTimeout(timeout: number | undefined) { + if (!timeout) { + return; + } + + this.requestInit = { + ...this.requestInit, + signal: AbortSignal.timeout(timeout), + }; + } + + private getHeaders(response: Response): Record { + const headers: Record = {}; + response.headers.forEach((value: string, key: string) => { + headers[key] = value; + }); + + return headers; + } +} diff --git a/src/http/transport/request.ts b/src/http/transport/request.ts new file mode 100644 index 0000000..92d5648 --- /dev/null +++ b/src/http/transport/request.ts @@ -0,0 +1,209 @@ +import { ZodType } from 'zod'; +import { ContentType, HttpMethod, SdkConfig, RetryOptions, ValidationOptions } from '../types'; +import { PathSerializer } from '../serialization/path-serializer'; +import { QuerySerializer } from '../serialization/query-serializer'; +import { HeaderSerializer } from '../serialization/header-serializer'; +import { HttpRequest } from '../hooks/hook'; +import { SerializationStyle } from '../serialization/base-serializer'; + +export interface CreateRequestParameters { + baseUrl: string; + method: HttpMethod; + body?: any; + headers: Map; + queryParams: Map; + pathParams: Map; + path: string; + config: SdkConfig; + responseSchema: ZodType; + requestSchema: ZodType; + requestContentType: ContentType; + responseContentType: ContentType; + validation: ValidationOptions; + retry: RetryOptions; +} + +export interface RequestParameter { + key: string | undefined; + value: unknown; + explode: boolean; + encode: boolean; + style: SerializationStyle; +} + +export class Request { + public baseUrl: string = ''; + + public headers: Map = new Map(); + + public queryParams: Map = new Map(); + + public pathParams: Map = new Map(); + + public body?: any; + + public method: HttpMethod; + + public path: string; + + public config: SdkConfig; + + public responseSchema: ZodType; + + public requestSchema: ZodType; + + public requestContentType: ContentType; + + public responseContentType: ContentType; + + public validation: ValidationOptions = {} as any; + + public retry: RetryOptions = {} as any; + + private readonly pathPattern: string; + + constructor(params: CreateRequestParameters) { + this.baseUrl = params.baseUrl; + this.method = params.method; + this.pathPattern = params.path; + this.body = params.body; + this.path = this.constructPath(); + this.config = params.config; + this.pathParams = params.pathParams; + this.headers = params.headers; + this.queryParams = params.queryParams; + this.responseSchema = params.responseSchema; + this.requestSchema = params.requestSchema; + this.requestContentType = params.requestContentType; + this.responseContentType = params.responseContentType; + this.retry = params.retry; + this.validation = params.validation; + } + + addHeaderParam(key: string, param: RequestParameter): void { + if (param.value === undefined) { + return; + } + + if (param.explode === undefined) { + param.explode = false; + } + + if (param.style === undefined) { + param.style = SerializationStyle.SIMPLE; + } + + if (param.encode === undefined) { + param.encode = false; + } + + this.headers.set(key, param); + } + + addQueryParam(key: string, param: RequestParameter): void { + if (param.value === undefined) { + return; + } + + if (param.explode === undefined) { + param.explode = true; + } + + if (param.style === undefined) { + param.style = SerializationStyle.FORM; + } + + if (param.encode === undefined) { + param.encode = true; + } + + this.queryParams.set(key, param); + } + + addPathParam(key: string, param: RequestParameter): void { + if (param.value === undefined) { + return; + } + + if (param.explode === undefined) { + param.explode = false; + } + + if (param.style === undefined) { + param.style = SerializationStyle.SIMPLE; + } + + if (param.encode === undefined) { + param.encode = true; + } + + this.pathParams.set(key, param); + } + + addBody(body: any): void { + if (body === undefined) { + return; + } + + this.body = body; + } + + public updateFromHookRequest(hookRequest: HttpRequest): void { + this.baseUrl = hookRequest.baseUrl; + this.method = hookRequest.method; + this.path = hookRequest.path; + this.body = hookRequest.body; + } + + public toHookRequest(): HttpRequest { + return { + baseUrl: this.baseUrl, + method: this.method, + path: this.path, + headers: this.headers, + body: this.body, + queryParams: this.queryParams, + }; + } + + public constructFullUrl(): string { + const queryString = new QuerySerializer().serialize(this.queryParams); + const path = this.constructPath(); + return `${this.baseUrl}${path}${queryString}`; + } + + public copy(overrides?: Partial>) { + const createRequestParams: CreateRequestParameters = { + baseUrl: overrides?.baseUrl ?? this.baseUrl, + method: overrides?.method ?? this.method, + path: overrides?.path ?? this.path, + body: overrides?.body ?? this.body, + config: overrides?.config ?? this.config, + pathParams: overrides?.pathParams ?? this.pathParams, + queryParams: overrides?.queryParams ?? this.queryParams, + headers: overrides?.headers ?? this.headers, + responseSchema: overrides?.responseSchema ?? this.responseSchema, + requestSchema: overrides?.requestSchema ?? this.requestSchema, + requestContentType: overrides?.requestContentType ?? this.requestContentType, + responseContentType: overrides?.responseContentType ?? this.responseContentType, + retry: overrides?.retry ?? this.retry, + validation: overrides?.validation ?? this.validation, + }; + return new Request({ + ...createRequestParams, + ...overrides, + }); + } + + public getHeaders(): HeadersInit | undefined { + if (!this.headers || !this.headers.size) { + return undefined; + } + + return new HeaderSerializer().serialize(this.headers); + } + + private constructPath(): string { + return new PathSerializer().serialize(this.pathPattern, this.pathParams); + } +} diff --git a/src/http/transport/transport-hook-adapter.ts b/src/http/transport/transport-hook-adapter.ts new file mode 100644 index 0000000..82f30d3 --- /dev/null +++ b/src/http/transport/transport-hook-adapter.ts @@ -0,0 +1,85 @@ +import { CustomHook } from '../hooks/custom-hook'; +import { HttpRequest, HttpError } from '../hooks/hook'; +import { SerializationStyle } from '../serialization/base-serializer'; +import { HttpResponse } from '../types'; +import { Request, RequestParameter } from './request'; + +export class TransportHookAdapter { + private hook: CustomHook = new CustomHook(); + + public async beforeRequest(request: Request, params: Map): Promise> { + const hookRequest = this.requestToHookRequest(request); + + const newRequest = await this.hook.beforeRequest(hookRequest, params); + + const newTransportRequest = request.copy({ + baseUrl: newRequest.baseUrl, + method: newRequest.method, + path: newRequest.path, + body: newRequest.body, + queryParams: this.hookParamsToTransportParams(newRequest.queryParams, request.queryParams, true), + headers: this.hookParamsToTransportParams(newRequest.headers, request.headers, false), + }); + + return newTransportRequest; + } + + public async afterResponse( + request: Request, + response: HttpResponse, + params: Map, + ): Promise> { + const hookRequest = this.requestToHookRequest(request); + return this.hook.afterResponse(hookRequest, response, params); + } + + public async onError( + request: Request, + response: HttpResponse, + params: Map, + ): Promise { + const hookRequest = this.requestToHookRequest(request); + return this.hook.onError(hookRequest, response, params); + } + + private requestToHookRequest(request: Request): HttpRequest { + const hookHeaders: Map = new Map(); + request.headers.forEach((header, key) => { + hookHeaders.set(key, header.value); + }); + + const hookQueryParams: Map = new Map(); + request.queryParams.forEach((queryParam, key) => { + hookQueryParams.set(key, queryParam.value); + }); + + const hookRequest: HttpRequest = { + baseUrl: request.baseUrl, + method: request.method, + path: request.path, + headers: hookHeaders, + body: request.body, + queryParams: hookQueryParams, + }; + return hookRequest; + } + + private hookParamsToTransportParams( + hookParams: Map, + originalTransportParams: Map, + encode: boolean, + ): Map { + const transportParams: Map = new Map(); + hookParams.forEach((hookParamValue, hookParamKey) => { + const requestParam = originalTransportParams.get(hookParamKey); + transportParams.set(hookParamKey, { + key: hookParamKey, + value: hookParamValue, + encode: requestParam?.encode ?? false, + style: requestParam?.style || SerializationStyle.NONE, + explode: requestParam?.explode ?? false, + }); + }); + return transportParams; + } +} diff --git a/src/http/types.ts b/src/http/types.ts new file mode 100644 index 0000000..68d6776 --- /dev/null +++ b/src/http/types.ts @@ -0,0 +1,70 @@ +import { ZodType } from 'zod'; +import { Environment } from './environment'; +import { Request } from './transport/request'; + +export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; + +export interface SdkConfig { + baseUrl?: string; + environment?: Environment; + timeout?: number; + apiKey?: string; + apiKeyHeader?: string; + retry?: RetryOptions; + validation?: ValidationOptions; +} + +export interface HttpMetadata { + status: number; + statusText: string; + headers: Record; +} + +export interface HttpResponse { + data?: T; + metadata: HttpMetadata; + raw: ArrayBuffer; +} + +export interface RequestHandler { + next?: RequestHandler; + + handle(request: Request): Promise>; +} + +export enum ContentType { + Json = 'json', + Xml = 'xml', + Pdf = 'pdf', + Image = 'image', + File = 'file', + Binary = 'binary', + FormUrlEncoded = 'form', + Text = 'text', + MultipartFormData = 'multipartFormData', +} + +export interface Options { + responseSchema: ZodType; + requestSchema?: ZodType; + body?: any; + requestContentType?: ContentType; + responseContentType?: ContentType; + abortSignal?: AbortSignal; + queryParams?: Record; + retry?: RetryOptions; +} + +export interface RequestConfig { + retry?: RetryOptions; + validation?: ValidationOptions; +} + +export interface RetryOptions { + attempts: number; + delayMs?: number; +} + +export interface ValidationOptions { + responseValidation?: boolean; +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..62b4644 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,108 @@ +import { Environment } from './http/environment'; +import { SdkConfig } from './http/types'; +import { ContainerGroupsService } from './services/container-groups'; +import { WorkloadErrorsService } from './services/workload-errors'; +import { QueuesService } from './services/queues'; +import { QuotasService } from './services/quotas'; +import { InferenceEndpointsService } from './services/inference-endpoints'; +import { OrganizationDataService } from './services/organization-data'; +import { WebhookSecretKeyService } from './services/webhook-secret-key'; + +export * from './services/container-groups'; +export * from './services/workload-errors'; +export * from './services/queues'; +export * from './services/quotas'; +export * from './services/inference-endpoints'; +export * from './services/organization-data'; +export * from './services/webhook-secret-key'; + +export type * from './http'; + +export class SaladCloudSdk { + public readonly containerGroups: ContainerGroupsService; + + public readonly workloadErrors: WorkloadErrorsService; + + public readonly queues: QueuesService; + + public readonly quotas: QuotasService; + + public readonly inferenceEndpoints: InferenceEndpointsService; + + public readonly organizationData: OrganizationDataService; + + public readonly webhookSecretKey: WebhookSecretKeyService; + + constructor(public config: SdkConfig) { + const baseUrl = config.environment || config.baseUrl || Environment.DEFAULT; + this.config = { + ...config, + baseUrl, + }; + this.containerGroups = new ContainerGroupsService(this.config); + + this.workloadErrors = new WorkloadErrorsService(this.config); + + this.queues = new QueuesService(this.config); + + this.quotas = new QuotasService(this.config); + + this.inferenceEndpoints = new InferenceEndpointsService(this.config); + + this.organizationData = new OrganizationDataService(this.config); + + this.webhookSecretKey = new WebhookSecretKeyService(this.config); + } + + set baseUrl(baseUrl: string) { + this.containerGroups.baseUrl = baseUrl; + this.workloadErrors.baseUrl = baseUrl; + this.queues.baseUrl = baseUrl; + this.quotas.baseUrl = baseUrl; + this.inferenceEndpoints.baseUrl = baseUrl; + this.organizationData.baseUrl = baseUrl; + this.webhookSecretKey.baseUrl = baseUrl; + } + + set environment(environment: Environment) { + this.containerGroups.baseUrl = environment; + this.workloadErrors.baseUrl = environment; + this.queues.baseUrl = environment; + this.quotas.baseUrl = environment; + this.inferenceEndpoints.baseUrl = environment; + this.organizationData.baseUrl = environment; + this.webhookSecretKey.baseUrl = environment; + } + + set timeout(timeout: number) { + this.containerGroups.timeout = timeout; + this.workloadErrors.timeout = timeout; + this.queues.timeout = timeout; + this.quotas.timeout = timeout; + this.inferenceEndpoints.timeout = timeout; + this.organizationData.timeout = timeout; + this.webhookSecretKey.timeout = timeout; + } + + set apiKey(apiKey: string) { + this.containerGroups.apiKey = apiKey; + this.workloadErrors.apiKey = apiKey; + this.queues.apiKey = apiKey; + this.quotas.apiKey = apiKey; + this.inferenceEndpoints.apiKey = apiKey; + this.organizationData.apiKey = apiKey; + this.webhookSecretKey.apiKey = apiKey; + } + + set apiKeyHeader(apiKeyHeader: string) { + this.containerGroups.apiKeyHeader = apiKeyHeader; + this.workloadErrors.apiKeyHeader = apiKeyHeader; + this.queues.apiKeyHeader = apiKeyHeader; + this.quotas.apiKeyHeader = apiKeyHeader; + this.inferenceEndpoints.apiKeyHeader = apiKeyHeader; + this.organizationData.apiKeyHeader = apiKeyHeader; + this.webhookSecretKey.apiKeyHeader = apiKeyHeader; + } +} + +// c029837e0e474b76bc487506e8799df5e3335891efe4fb02bda7a1441840310c diff --git a/src/services/base-service.ts b/src/services/base-service.ts new file mode 100644 index 0000000..9cabaf4 --- /dev/null +++ b/src/services/base-service.ts @@ -0,0 +1,31 @@ +import { Environment } from '../http/environment'; +import { HttpClient } from '../http/client'; +import { SdkConfig } from '../http/types'; + +export class BaseService { + public client: HttpClient; + + constructor(public config: SdkConfig) { + this.client = new HttpClient(this.config); + } + + set baseUrl(baseUrl: string) { + this.config.baseUrl = baseUrl; + } + + set environment(environment: Environment) { + this.config.environment = environment; + } + + set timeout(timeout: number) { + this.config.timeout = timeout; + } + + set apiKey(apiKey: string) { + this.config.apiKey = apiKey; + } + + set apiKeyHeader(apiKeyHeader: string) { + this.config.apiKeyHeader = apiKeyHeader; + } +} diff --git a/src/services/common/container-group-instance-status-count.ts b/src/services/common/container-group-instance-status-count.ts new file mode 100644 index 0000000..6c64868 --- /dev/null +++ b/src/services/common/container-group-instance-status-count.ts @@ -0,0 +1,63 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupInstanceStatusCount = z.lazy(() => { + return z.object({ + allocatingCount: z.number().gte(0), + creatingCount: z.number().gte(0), + runningCount: z.number().gte(0), + stoppingCount: z.number().gte(0), + }); +}); + +/** + * Represents a container group instance status count + * @typedef {ContainerGroupInstanceStatusCount} containerGroupInstanceStatusCount - Represents a container group instance status count - Represents a container group instance status count + * @property {number} + * @property {number} + * @property {number} + * @property {number} + */ +export type ContainerGroupInstanceStatusCount = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupInstanceStatusCountResponse = z.lazy(() => { + return z + .object({ + allocating_count: z.number().gte(0), + creating_count: z.number().gte(0), + running_count: z.number().gte(0), + stopping_count: z.number().gte(0), + }) + .transform((data) => ({ + allocatingCount: data['allocating_count'], + creatingCount: data['creating_count'], + runningCount: data['running_count'], + stoppingCount: data['stopping_count'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupInstanceStatusCountRequest = z.lazy(() => { + return z + .object({ + allocatingCount: z.number().nullish(), + creatingCount: z.number().nullish(), + runningCount: z.number().nullish(), + stoppingCount: z.number().nullish(), + }) + .transform((data) => ({ + allocating_count: data['allocatingCount'], + creating_count: data['creatingCount'], + running_count: data['runningCount'], + stopping_count: data['stoppingCount'], + })); +}); diff --git a/src/services/common/container-group-liveness-probe.ts b/src/services/common/container-group-liveness-probe.ts new file mode 100644 index 0000000..cc467fb --- /dev/null +++ b/src/services/common/container-group-liveness-probe.ts @@ -0,0 +1,113 @@ +import { z } from 'zod'; +import { + containerGroupProbeTcp, + containerGroupProbeTcpRequest, + containerGroupProbeTcpResponse, +} from './container-group-probe-tcp'; +import { + containerGroupProbeHttp, + containerGroupProbeHttpRequest, + containerGroupProbeHttpResponse, +} from './container-group-probe-http'; +import { + containerGroupProbeGrpc, + containerGroupProbeGrpcRequest, + containerGroupProbeGrpcResponse, +} from './container-group-probe-grpc'; +import { + containerGroupProbeExec, + containerGroupProbeExecRequest, + containerGroupProbeExecResponse, +} from './container-group-probe-exec'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupLivenessProbe = z.lazy(() => { + return z.object({ + tcp: containerGroupProbeTcp.optional(), + http: containerGroupProbeHttp.optional(), + grpc: containerGroupProbeGrpc.optional(), + exec: containerGroupProbeExec.optional(), + initialDelaySeconds: z.number().gte(0), + periodSeconds: z.number().gte(1), + timeoutSeconds: z.number().gte(1), + successThreshold: z.number().gte(1), + failureThreshold: z.number().gte(1), + }); +}); + +/** + * Represents the container group liveness probe + * @typedef {ContainerGroupLivenessProbe} containerGroupLivenessProbe - Represents the container group liveness probe - Represents the container group liveness probe + * @property {ContainerGroupProbeTcp} + * @property {ContainerGroupProbeHttp} + * @property {ContainerGroupProbeGrpc} + * @property {ContainerGroupProbeExec} + * @property {number} + * @property {number} + * @property {number} + * @property {number} + * @property {number} + */ +export type ContainerGroupLivenessProbe = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupLivenessProbeResponse = z.lazy(() => { + return z + .object({ + tcp: containerGroupProbeTcpResponse.optional(), + http: containerGroupProbeHttpResponse.optional(), + grpc: containerGroupProbeGrpcResponse.optional(), + exec: containerGroupProbeExecResponse.optional(), + initial_delay_seconds: z.number().gte(0), + period_seconds: z.number().gte(1), + timeout_seconds: z.number().gte(1), + success_threshold: z.number().gte(1), + failure_threshold: z.number().gte(1), + }) + .transform((data) => ({ + tcp: data['tcp'], + http: data['http'], + grpc: data['grpc'], + exec: data['exec'], + initialDelaySeconds: data['initial_delay_seconds'], + periodSeconds: data['period_seconds'], + timeoutSeconds: data['timeout_seconds'], + successThreshold: data['success_threshold'], + failureThreshold: data['failure_threshold'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupLivenessProbeRequest = z.lazy(() => { + return z + .object({ + tcp: containerGroupProbeTcpRequest.nullish(), + http: containerGroupProbeHttpRequest.nullish(), + grpc: containerGroupProbeGrpcRequest.nullish(), + exec: containerGroupProbeExecRequest.nullish(), + initialDelaySeconds: z.number().nullish(), + periodSeconds: z.number().nullish(), + timeoutSeconds: z.number().nullish(), + successThreshold: z.number().nullish(), + failureThreshold: z.number().nullish(), + }) + .transform((data) => ({ + tcp: data['tcp'], + http: data['http'], + grpc: data['grpc'], + exec: data['exec'], + initial_delay_seconds: data['initialDelaySeconds'], + period_seconds: data['periodSeconds'], + timeout_seconds: data['timeoutSeconds'], + success_threshold: data['successThreshold'], + failure_threshold: data['failureThreshold'], + })); +}); diff --git a/src/services/common/container-group-networking.ts b/src/services/common/container-group-networking.ts new file mode 100644 index 0000000..834b6eb --- /dev/null +++ b/src/services/common/container-group-networking.ts @@ -0,0 +1,63 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupNetworking = z.lazy(() => { + return z.object({ + protocol: z.string(), + port: z.number().gte(1).lte(65535), + auth: z.boolean(), + dns: z.string(), + }); +}); + +/** + * Represents container group networking parameters + * @typedef {ContainerGroupNetworking} containerGroupNetworking - Represents container group networking parameters - Represents container group networking parameters + * @property {ContainerNetworkingProtocol} + * @property {number} + * @property {boolean} + * @property {string} + */ +export type ContainerGroupNetworking = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupNetworkingResponse = z.lazy(() => { + return z + .object({ + protocol: z.string(), + port: z.number().gte(1).lte(65535), + auth: z.boolean(), + dns: z.string(), + }) + .transform((data) => ({ + protocol: data['protocol'], + port: data['port'], + auth: data['auth'], + dns: data['dns'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupNetworkingRequest = z.lazy(() => { + return z + .object({ + protocol: z.string().nullish(), + port: z.number().nullish(), + auth: z.boolean().nullish(), + dns: z.string().nullish(), + }) + .transform((data) => ({ + protocol: data['protocol'], + port: data['port'], + auth: data['auth'], + dns: data['dns'], + })); +}); diff --git a/src/services/common/container-group-priority.ts b/src/services/common/container-group-priority.ts new file mode 100644 index 0000000..868d106 --- /dev/null +++ b/src/services/common/container-group-priority.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export enum ContainerGroupPriority { + HIGH = 'high', + MEDIUM = 'medium', + LOW = 'low', + BATCH = 'batch', +} diff --git a/src/services/common/container-group-probe-exec.ts b/src/services/common/container-group-probe-exec.ts new file mode 100644 index 0000000..905024d --- /dev/null +++ b/src/services/common/container-group-probe-exec.ts @@ -0,0 +1,41 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupProbeExec = z.lazy(() => { + return z.object({ + command: z.array(z.string()), + }); +}); + +/** + * + * @typedef {ContainerGroupProbeExec} containerGroupProbeExec + * @property {string[]} + */ +export type ContainerGroupProbeExec = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupProbeExecResponse = z.lazy(() => { + return z + .object({ + command: z.array(z.string()), + }) + .transform((data) => ({ + command: data['command'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupProbeExecRequest = z.lazy(() => { + return z.object({ command: z.array(z.string()).nullish() }).transform((data) => ({ + command: data['command'], + })); +}); diff --git a/src/services/common/container-group-probe-grpc.ts b/src/services/common/container-group-probe-grpc.ts new file mode 100644 index 0000000..ade9c44 --- /dev/null +++ b/src/services/common/container-group-probe-grpc.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupProbeGrpc = z.lazy(() => { + return z.object({ + service: z.string(), + port: z.number().gte(0).lte(65536), + }); +}); + +/** + * + * @typedef {ContainerGroupProbeGrpc} containerGroupProbeGrpc + * @property {string} + * @property {number} + */ +export type ContainerGroupProbeGrpc = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupProbeGrpcResponse = z.lazy(() => { + return z + .object({ + service: z.string(), + port: z.number().gte(0).lte(65536), + }) + .transform((data) => ({ + service: data['service'], + port: data['port'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupProbeGrpcRequest = z.lazy(() => { + return z.object({ service: z.string().nullish(), port: z.number().nullish() }).transform((data) => ({ + service: data['service'], + port: data['port'], + })); +}); diff --git a/src/services/common/container-group-probe-http-headers-2.ts b/src/services/common/container-group-probe-http-headers-2.ts new file mode 100644 index 0000000..111bc14 --- /dev/null +++ b/src/services/common/container-group-probe-http-headers-2.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupProbeHttpHeaders2 = z.lazy(() => { + return z.object({ + name: z.string(), + value: z.string(), + }); +}); + +/** + * + * @typedef {ContainerGroupProbeHttpHeaders2} containerGroupProbeHttpHeaders2 + * @property {string} + * @property {string} + */ +export type ContainerGroupProbeHttpHeaders2 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupProbeHttpHeaders2Response = z.lazy(() => { + return z + .object({ + name: z.string(), + value: z.string(), + }) + .transform((data) => ({ + name: data['name'], + value: data['value'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupProbeHttpHeaders2Request = z.lazy(() => { + return z.object({ name: z.string().nullish(), value: z.string().nullish() }).transform((data) => ({ + name: data['name'], + value: data['value'], + })); +}); diff --git a/src/services/common/container-group-probe-http.ts b/src/services/common/container-group-probe-http.ts new file mode 100644 index 0000000..4f3caa0 --- /dev/null +++ b/src/services/common/container-group-probe-http.ts @@ -0,0 +1,68 @@ +import { z } from 'zod'; +import { + containerGroupProbeHttpHeaders2, + containerGroupProbeHttpHeaders2Request, + containerGroupProbeHttpHeaders2Response, +} from './container-group-probe-http-headers-2'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupProbeHttp = z.lazy(() => { + return z.object({ + path: z.string(), + port: z.number().gte(0).lte(65536), + scheme: z.string().optional(), + headers: z.array(containerGroupProbeHttpHeaders2).optional(), + }); +}); + +/** + * + * @typedef {ContainerGroupProbeHttp} containerGroupProbeHttp + * @property {string} + * @property {number} + * @property {ContainerProbeHttpScheme} + * @property {ContainerGroupProbeHttpHeaders2[]} + */ +export type ContainerGroupProbeHttp = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupProbeHttpResponse = z.lazy(() => { + return z + .object({ + path: z.string(), + port: z.number().gte(0).lte(65536), + scheme: z.string().optional(), + headers: z.array(containerGroupProbeHttpHeaders2Response).optional(), + }) + .transform((data) => ({ + path: data['path'], + port: data['port'], + scheme: data['scheme'], + headers: data['headers'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupProbeHttpRequest = z.lazy(() => { + return z + .object({ + path: z.string().nullish(), + port: z.number().nullish(), + scheme: z.string().nullish(), + headers: z.array(containerGroupProbeHttpHeaders2Request).nullish(), + }) + .transform((data) => ({ + path: data['path'], + port: data['port'], + scheme: data['scheme'], + headers: data['headers'], + })); +}); diff --git a/src/services/common/container-group-probe-tcp.ts b/src/services/common/container-group-probe-tcp.ts new file mode 100644 index 0000000..64186f0 --- /dev/null +++ b/src/services/common/container-group-probe-tcp.ts @@ -0,0 +1,41 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupProbeTcp = z.lazy(() => { + return z.object({ + port: z.number().gte(0).lte(65536), + }); +}); + +/** + * + * @typedef {ContainerGroupProbeTcp} containerGroupProbeTcp + * @property {number} + */ +export type ContainerGroupProbeTcp = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupProbeTcpResponse = z.lazy(() => { + return z + .object({ + port: z.number().gte(0).lte(65536), + }) + .transform((data) => ({ + port: data['port'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupProbeTcpRequest = z.lazy(() => { + return z.object({ port: z.number().nullish() }).transform((data) => ({ + port: data['port'], + })); +}); diff --git a/src/services/common/container-group-queue-connection.ts b/src/services/common/container-group-queue-connection.ts new file mode 100644 index 0000000..b3df118 --- /dev/null +++ b/src/services/common/container-group-queue-connection.ts @@ -0,0 +1,61 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupQueueConnection = z.lazy(() => { + return z.object({ + path: z.string().min(1).max(1024), + port: z.number().gte(1).lte(65535), + queueName: z + .string() + .min(2) + .max(63) + .regex(/^[a-z][a-z0-9-]{0,61}[a-z0-9]$/), + }); +}); + +/** + * Represents container group queue connection + * @typedef {ContainerGroupQueueConnection} containerGroupQueueConnection - Represents container group queue connection - Represents container group queue connection + * @property {string} + * @property {number} + * @property {string} + */ +export type ContainerGroupQueueConnection = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupQueueConnectionResponse = z.lazy(() => { + return z + .object({ + path: z.string().min(1).max(1024), + port: z.number().gte(1).lte(65535), + queue_name: z + .string() + .min(2) + .max(63) + .regex(/^[a-z][a-z0-9-]{0,61}[a-z0-9]$/), + }) + .transform((data) => ({ + path: data['path'], + port: data['port'], + queueName: data['queue_name'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupQueueConnectionRequest = z.lazy(() => { + return z + .object({ path: z.string().nullish(), port: z.number().nullish(), queueName: z.string().nullish() }) + .transform((data) => ({ + path: data['path'], + port: data['port'], + queue_name: data['queueName'], + })); +}); diff --git a/src/services/common/container-group-readiness-probe.ts b/src/services/common/container-group-readiness-probe.ts new file mode 100644 index 0000000..cf79678 --- /dev/null +++ b/src/services/common/container-group-readiness-probe.ts @@ -0,0 +1,113 @@ +import { z } from 'zod'; +import { + containerGroupProbeTcp, + containerGroupProbeTcpRequest, + containerGroupProbeTcpResponse, +} from './container-group-probe-tcp'; +import { + containerGroupProbeHttp, + containerGroupProbeHttpRequest, + containerGroupProbeHttpResponse, +} from './container-group-probe-http'; +import { + containerGroupProbeGrpc, + containerGroupProbeGrpcRequest, + containerGroupProbeGrpcResponse, +} from './container-group-probe-grpc'; +import { + containerGroupProbeExec, + containerGroupProbeExecRequest, + containerGroupProbeExecResponse, +} from './container-group-probe-exec'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupReadinessProbe = z.lazy(() => { + return z.object({ + tcp: containerGroupProbeTcp.optional(), + http: containerGroupProbeHttp.optional(), + grpc: containerGroupProbeGrpc.optional(), + exec: containerGroupProbeExec.optional(), + initialDelaySeconds: z.number().gte(0), + periodSeconds: z.number().gte(1), + timeoutSeconds: z.number().gte(1), + successThreshold: z.number().gte(1), + failureThreshold: z.number().gte(1), + }); +}); + +/** + * Represents the container group readiness probe + * @typedef {ContainerGroupReadinessProbe} containerGroupReadinessProbe - Represents the container group readiness probe - Represents the container group readiness probe + * @property {ContainerGroupProbeTcp} + * @property {ContainerGroupProbeHttp} + * @property {ContainerGroupProbeGrpc} + * @property {ContainerGroupProbeExec} + * @property {number} + * @property {number} + * @property {number} + * @property {number} + * @property {number} + */ +export type ContainerGroupReadinessProbe = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupReadinessProbeResponse = z.lazy(() => { + return z + .object({ + tcp: containerGroupProbeTcpResponse.optional(), + http: containerGroupProbeHttpResponse.optional(), + grpc: containerGroupProbeGrpcResponse.optional(), + exec: containerGroupProbeExecResponse.optional(), + initial_delay_seconds: z.number().gte(0), + period_seconds: z.number().gte(1), + timeout_seconds: z.number().gte(1), + success_threshold: z.number().gte(1), + failure_threshold: z.number().gte(1), + }) + .transform((data) => ({ + tcp: data['tcp'], + http: data['http'], + grpc: data['grpc'], + exec: data['exec'], + initialDelaySeconds: data['initial_delay_seconds'], + periodSeconds: data['period_seconds'], + timeoutSeconds: data['timeout_seconds'], + successThreshold: data['success_threshold'], + failureThreshold: data['failure_threshold'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupReadinessProbeRequest = z.lazy(() => { + return z + .object({ + tcp: containerGroupProbeTcpRequest.nullish(), + http: containerGroupProbeHttpRequest.nullish(), + grpc: containerGroupProbeGrpcRequest.nullish(), + exec: containerGroupProbeExecRequest.nullish(), + initialDelaySeconds: z.number().nullish(), + periodSeconds: z.number().nullish(), + timeoutSeconds: z.number().nullish(), + successThreshold: z.number().nullish(), + failureThreshold: z.number().nullish(), + }) + .transform((data) => ({ + tcp: data['tcp'], + http: data['http'], + grpc: data['grpc'], + exec: data['exec'], + initial_delay_seconds: data['initialDelaySeconds'], + period_seconds: data['periodSeconds'], + timeout_seconds: data['timeoutSeconds'], + success_threshold: data['successThreshold'], + failure_threshold: data['failureThreshold'], + })); +}); diff --git a/src/services/common/container-group-startup-probe.ts b/src/services/common/container-group-startup-probe.ts new file mode 100644 index 0000000..7f5fd51 --- /dev/null +++ b/src/services/common/container-group-startup-probe.ts @@ -0,0 +1,113 @@ +import { z } from 'zod'; +import { + containerGroupProbeTcp, + containerGroupProbeTcpRequest, + containerGroupProbeTcpResponse, +} from './container-group-probe-tcp'; +import { + containerGroupProbeHttp, + containerGroupProbeHttpRequest, + containerGroupProbeHttpResponse, +} from './container-group-probe-http'; +import { + containerGroupProbeGrpc, + containerGroupProbeGrpcRequest, + containerGroupProbeGrpcResponse, +} from './container-group-probe-grpc'; +import { + containerGroupProbeExec, + containerGroupProbeExecRequest, + containerGroupProbeExecResponse, +} from './container-group-probe-exec'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupStartupProbe = z.lazy(() => { + return z.object({ + tcp: containerGroupProbeTcp.optional(), + http: containerGroupProbeHttp.optional(), + grpc: containerGroupProbeGrpc.optional(), + exec: containerGroupProbeExec.optional(), + initialDelaySeconds: z.number().gte(0), + periodSeconds: z.number().gte(1), + timeoutSeconds: z.number().gte(1), + successThreshold: z.number().gte(1), + failureThreshold: z.number().gte(1), + }); +}); + +/** + * Represents the container group startup probe + * @typedef {ContainerGroupStartupProbe} containerGroupStartupProbe - Represents the container group startup probe - Represents the container group startup probe + * @property {ContainerGroupProbeTcp} + * @property {ContainerGroupProbeHttp} + * @property {ContainerGroupProbeGrpc} + * @property {ContainerGroupProbeExec} + * @property {number} + * @property {number} + * @property {number} + * @property {number} + * @property {number} + */ +export type ContainerGroupStartupProbe = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupStartupProbeResponse = z.lazy(() => { + return z + .object({ + tcp: containerGroupProbeTcpResponse.optional(), + http: containerGroupProbeHttpResponse.optional(), + grpc: containerGroupProbeGrpcResponse.optional(), + exec: containerGroupProbeExecResponse.optional(), + initial_delay_seconds: z.number().gte(0), + period_seconds: z.number().gte(1), + timeout_seconds: z.number().gte(1), + success_threshold: z.number().gte(1), + failure_threshold: z.number().gte(1), + }) + .transform((data) => ({ + tcp: data['tcp'], + http: data['http'], + grpc: data['grpc'], + exec: data['exec'], + initialDelaySeconds: data['initial_delay_seconds'], + periodSeconds: data['period_seconds'], + timeoutSeconds: data['timeout_seconds'], + successThreshold: data['success_threshold'], + failureThreshold: data['failure_threshold'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupStartupProbeRequest = z.lazy(() => { + return z + .object({ + tcp: containerGroupProbeTcpRequest.nullish(), + http: containerGroupProbeHttpRequest.nullish(), + grpc: containerGroupProbeGrpcRequest.nullish(), + exec: containerGroupProbeExecRequest.nullish(), + initialDelaySeconds: z.number().nullish(), + periodSeconds: z.number().nullish(), + timeoutSeconds: z.number().nullish(), + successThreshold: z.number().nullish(), + failureThreshold: z.number().nullish(), + }) + .transform((data) => ({ + tcp: data['tcp'], + http: data['http'], + grpc: data['grpc'], + exec: data['exec'], + initial_delay_seconds: data['initialDelaySeconds'], + period_seconds: data['periodSeconds'], + timeout_seconds: data['timeoutSeconds'], + success_threshold: data['successThreshold'], + failure_threshold: data['failureThreshold'], + })); +}); diff --git a/src/services/common/container-group-state.ts b/src/services/common/container-group-state.ts new file mode 100644 index 0000000..ac55020 --- /dev/null +++ b/src/services/common/container-group-state.ts @@ -0,0 +1,74 @@ +import { z } from 'zod'; +import { + containerGroupInstanceStatusCount, + containerGroupInstanceStatusCountRequest, + containerGroupInstanceStatusCountResponse, +} from './container-group-instance-status-count'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupState = z.lazy(() => { + return z.object({ + status: z.string(), + description: z.string().optional().nullable(), + startTime: z.string(), + finishTime: z.string(), + instanceStatusCounts: containerGroupInstanceStatusCount, + }); +}); + +/** + * Represents a container group state + * @typedef {ContainerGroupState} containerGroupState - Represents a container group state - Represents a container group state + * @property {ContainerGroupStatus} + * @property {string} + * @property {string} + * @property {string} + * @property {ContainerGroupInstanceStatusCount} - Represents a container group instance status count + */ +export type ContainerGroupState = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupStateResponse = z.lazy(() => { + return z + .object({ + status: z.string(), + description: z.string().optional().nullable(), + start_time: z.string(), + finish_time: z.string(), + instance_status_counts: containerGroupInstanceStatusCountResponse, + }) + .transform((data) => ({ + status: data['status'], + description: data['description'], + startTime: data['start_time'], + finishTime: data['finish_time'], + instanceStatusCounts: data['instance_status_counts'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupStateRequest = z.lazy(() => { + return z + .object({ + status: z.string().nullish(), + description: z.string().nullish(), + startTime: z.string().nullish(), + finishTime: z.string().nullish(), + instanceStatusCounts: containerGroupInstanceStatusCountRequest.nullish(), + }) + .transform((data) => ({ + status: data['status'], + description: data['description'], + start_time: data['startTime'], + finish_time: data['finishTime'], + instance_status_counts: data['instanceStatusCounts'], + })); +}); diff --git a/src/services/common/container-group-status.ts b/src/services/common/container-group-status.ts new file mode 100644 index 0000000..f942c5c --- /dev/null +++ b/src/services/common/container-group-status.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export enum ContainerGroupStatus { + PENDING = 'pending', + RUNNING = 'running', + STOPPED = 'stopped', + SUCCEEDED = 'succeeded', + FAILED = 'failed', + DEPLOYING = 'deploying', +} diff --git a/src/services/common/container-group.ts b/src/services/common/container-group.ts new file mode 100644 index 0000000..dd47bfc --- /dev/null +++ b/src/services/common/container-group.ts @@ -0,0 +1,190 @@ +import { z } from 'zod'; +import { container, containerRequest, containerResponse } from './container'; +import { containerGroupState, containerGroupStateRequest, containerGroupStateResponse } from './container-group-state'; +import { + containerGroupNetworking, + containerGroupNetworkingRequest, + containerGroupNetworkingResponse, +} from './container-group-networking'; +import { + containerGroupLivenessProbe, + containerGroupLivenessProbeRequest, + containerGroupLivenessProbeResponse, +} from './container-group-liveness-probe'; +import { + containerGroupReadinessProbe, + containerGroupReadinessProbeRequest, + containerGroupReadinessProbeResponse, +} from './container-group-readiness-probe'; +import { + containerGroupStartupProbe, + containerGroupStartupProbeRequest, + containerGroupStartupProbeResponse, +} from './container-group-startup-probe'; +import { + containerGroupQueueConnection, + containerGroupQueueConnectionRequest, + containerGroupQueueConnectionResponse, +} from './container-group-queue-connection'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroup = z.lazy(() => { + return z.object({ + id: z.string(), + name: z + .string() + .min(2) + .max(63) + .regex(/^[a-z][a-z0-9-]{0,61}[a-z0-9]$/), + displayName: z + .string() + .min(2) + .max(63) + .regex(/^[ ,-.0-9A-Za-z]+$/), + container: container, + autostartPolicy: z.boolean(), + restartPolicy: z.string(), + replicas: z.number().gte(0).lte(100), + currentState: containerGroupState, + countryCodes: z.array(z.string()).min(1).max(500).optional(), + networking: containerGroupNetworking.optional().nullable(), + livenessProbe: containerGroupLivenessProbe.optional().nullable(), + readinessProbe: containerGroupReadinessProbe.optional().nullable(), + startupProbe: containerGroupStartupProbe.optional().nullable(), + queueConnection: containerGroupQueueConnection.optional().nullable(), + createTime: z.string(), + updateTime: z.string(), + pendingChange: z.boolean(), + version: z.number().gte(1), + }); +}); + +/** + * Represents a container group + * @typedef {ContainerGroup} containerGroup - Represents a container group - Represents a container group + * @property {string} + * @property {string} + * @property {string} + * @property {Container} - Represents a container + * @property {boolean} + * @property {ContainerRestartPolicy} + * @property {number} + * @property {ContainerGroupState} - Represents a container group state + * @property {CountryCode[]} - List of countries nodes must be located in. Remove this field to permit nodes from any country. + * @property {ContainerGroupNetworking} - Represents container group networking parameters + * @property {ContainerGroupLivenessProbe} - Represents the container group liveness probe + * @property {ContainerGroupReadinessProbe} - Represents the container group readiness probe + * @property {ContainerGroupStartupProbe} - Represents the container group startup probe + * @property {ContainerGroupQueueConnection} - Represents container group queue connection + * @property {string} + * @property {string} + * @property {boolean} + * @property {number} + */ +export type ContainerGroup = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupResponse = z.lazy(() => { + return z + .object({ + id: z.string(), + name: z + .string() + .min(2) + .max(63) + .regex(/^[a-z][a-z0-9-]{0,61}[a-z0-9]$/), + display_name: z + .string() + .min(2) + .max(63) + .regex(/^[ ,-.0-9A-Za-z]+$/), + container: containerResponse, + autostart_policy: z.boolean(), + restart_policy: z.string(), + replicas: z.number().gte(0).lte(100), + current_state: containerGroupStateResponse, + country_codes: z.array(z.string()).min(1).max(500).optional(), + networking: containerGroupNetworkingResponse.optional().nullable(), + liveness_probe: containerGroupLivenessProbeResponse.optional().nullable(), + readiness_probe: containerGroupReadinessProbeResponse.optional().nullable(), + startup_probe: containerGroupStartupProbeResponse.optional().nullable(), + queue_connection: containerGroupQueueConnectionResponse.optional().nullable(), + create_time: z.string(), + update_time: z.string(), + pending_change: z.boolean(), + version: z.number().gte(1), + }) + .transform((data) => ({ + id: data['id'], + name: data['name'], + displayName: data['display_name'], + container: data['container'], + autostartPolicy: data['autostart_policy'], + restartPolicy: data['restart_policy'], + replicas: data['replicas'], + currentState: data['current_state'], + countryCodes: data['country_codes'], + networking: data['networking'], + livenessProbe: data['liveness_probe'], + readinessProbe: data['readiness_probe'], + startupProbe: data['startup_probe'], + queueConnection: data['queue_connection'], + createTime: data['create_time'], + updateTime: data['update_time'], + pendingChange: data['pending_change'], + version: data['version'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupRequest = z.lazy(() => { + return z + .object({ + id: z.string().nullish(), + name: z.string().nullish(), + displayName: z.string().nullish(), + container: containerRequest.nullish(), + autostartPolicy: z.boolean().nullish(), + restartPolicy: z.string().nullish(), + replicas: z.number().nullish(), + currentState: containerGroupStateRequest.nullish(), + countryCodes: z.array(z.string()).nullish(), + networking: containerGroupNetworkingRequest.nullish(), + livenessProbe: containerGroupLivenessProbeRequest.nullish(), + readinessProbe: containerGroupReadinessProbeRequest.nullish(), + startupProbe: containerGroupStartupProbeRequest.nullish(), + queueConnection: containerGroupQueueConnectionRequest.nullish(), + createTime: z.string().nullish(), + updateTime: z.string().nullish(), + pendingChange: z.boolean().nullish(), + version: z.number().nullish(), + }) + .transform((data) => ({ + id: data['id'], + name: data['name'], + display_name: data['displayName'], + container: data['container'], + autostart_policy: data['autostartPolicy'], + restart_policy: data['restartPolicy'], + replicas: data['replicas'], + current_state: data['currentState'], + country_codes: data['countryCodes'], + networking: data['networking'], + liveness_probe: data['livenessProbe'], + readiness_probe: data['readinessProbe'], + startup_probe: data['startupProbe'], + queue_connection: data['queueConnection'], + create_time: data['createTime'], + update_time: data['updateTime'], + pending_change: data['pendingChange'], + version: data['version'], + })); +}); diff --git a/src/services/common/container-logging.ts b/src/services/common/container-logging.ts new file mode 100644 index 0000000..3dde8e8 --- /dev/null +++ b/src/services/common/container-logging.ts @@ -0,0 +1,81 @@ +import { z } from 'zod'; +import { loggingAxiom1, loggingAxiom1Request, loggingAxiom1Response } from './logging-axiom-1'; +import { loggingDatadog1, loggingDatadog1Request, loggingDatadog1Response } from './logging-datadog-1'; +import { loggingNewRelic1, loggingNewRelic1Request, loggingNewRelic1Response } from './logging-new-relic-1'; +import { loggingSplunk1, loggingSplunk1Request, loggingSplunk1Response } from './logging-splunk-1'; +import { loggingTcp1, loggingTcp1Request, loggingTcp1Response } from './logging-tcp-1'; +import { loggingHttp1, loggingHttp1Request, loggingHttp1Response } from './logging-http-1'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerLogging = z.lazy(() => { + return z.object({ + axiom: loggingAxiom1.optional().nullable(), + datadog: loggingDatadog1.optional().nullable(), + newRelic: loggingNewRelic1.optional().nullable(), + splunk: loggingSplunk1.optional().nullable(), + tcp: loggingTcp1.optional().nullable(), + http: loggingHttp1.optional().nullable(), + }); +}); + +/** + * + * @typedef {ContainerLogging} containerLogging + * @property {LoggingAxiom1} + * @property {LoggingDatadog1} + * @property {LoggingNewRelic1} + * @property {LoggingSplunk1} + * @property {LoggingTcp1} + * @property {LoggingHttp1} + */ +export type ContainerLogging = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerLoggingResponse = z.lazy(() => { + return z + .object({ + axiom: loggingAxiom1Response.optional().nullable(), + datadog: loggingDatadog1Response.optional().nullable(), + new_relic: loggingNewRelic1Response.optional().nullable(), + splunk: loggingSplunk1Response.optional().nullable(), + tcp: loggingTcp1Response.optional().nullable(), + http: loggingHttp1Response.optional().nullable(), + }) + .transform((data) => ({ + axiom: data['axiom'], + datadog: data['datadog'], + newRelic: data['new_relic'], + splunk: data['splunk'], + tcp: data['tcp'], + http: data['http'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerLoggingRequest = z.lazy(() => { + return z + .object({ + axiom: loggingAxiom1Request.nullish(), + datadog: loggingDatadog1Request.nullish(), + newRelic: loggingNewRelic1Request.nullish(), + splunk: loggingSplunk1Request.nullish(), + tcp: loggingTcp1Request.nullish(), + http: loggingHttp1Request.nullish(), + }) + .transform((data) => ({ + axiom: data['axiom'], + datadog: data['datadog'], + new_relic: data['newRelic'], + splunk: data['splunk'], + tcp: data['tcp'], + http: data['http'], + })); +}); diff --git a/src/services/common/container-networking-protocol.ts b/src/services/common/container-networking-protocol.ts new file mode 100644 index 0000000..11988a6 --- /dev/null +++ b/src/services/common/container-networking-protocol.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export enum ContainerNetworkingProtocol { + HTTP = 'http', +} diff --git a/src/services/common/container-probe-http-scheme.ts b/src/services/common/container-probe-http-scheme.ts new file mode 100644 index 0000000..df9ac36 --- /dev/null +++ b/src/services/common/container-probe-http-scheme.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export enum ContainerProbeHttpScheme { + HTTP = 'http', +} diff --git a/src/services/common/container-resource-requirements.ts b/src/services/common/container-resource-requirements.ts new file mode 100644 index 0000000..f083daf --- /dev/null +++ b/src/services/common/container-resource-requirements.ts @@ -0,0 +1,63 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerResourceRequirements = z.lazy(() => { + return z.object({ + cpu: z.number().gte(1).lte(16), + memory: z.number().gte(1024).lte(30720), + gpuClasses: z.array(z.string()).optional().nullable(), + storageAmount: z.number().gte(1073741824).lte(53687091200).optional().nullable(), + }); +}); + +/** + * Represents a container resource requirements + * @typedef {ContainerResourceRequirements} containerResourceRequirements - Represents a container resource requirements - Represents a container resource requirements + * @property {number} + * @property {number} + * @property {string[]} + * @property {number} + */ +export type ContainerResourceRequirements = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerResourceRequirementsResponse = z.lazy(() => { + return z + .object({ + cpu: z.number().gte(1).lte(16), + memory: z.number().gte(1024).lte(30720), + gpu_classes: z.array(z.string()).optional().nullable(), + storage_amount: z.number().gte(1073741824).lte(53687091200).optional().nullable(), + }) + .transform((data) => ({ + cpu: data['cpu'], + memory: data['memory'], + gpuClasses: data['gpu_classes'], + storageAmount: data['storage_amount'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerResourceRequirementsRequest = z.lazy(() => { + return z + .object({ + cpu: z.number().nullish(), + memory: z.number().nullish(), + gpuClasses: z.array(z.string()).nullish(), + storageAmount: z.number().nullish(), + }) + .transform((data) => ({ + cpu: data['cpu'], + memory: data['memory'], + gpu_classes: data['gpuClasses'], + storage_amount: data['storageAmount'], + })); +}); diff --git a/src/services/common/container-restart-policy.ts b/src/services/common/container-restart-policy.ts new file mode 100644 index 0000000..6f4212b --- /dev/null +++ b/src/services/common/container-restart-policy.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export enum ContainerRestartPolicy { + ALWAYS = 'always', + ONFAILURE = 'on_failure', + NEVER = 'never', +} diff --git a/src/services/common/container.ts b/src/services/common/container.ts new file mode 100644 index 0000000..e558540 --- /dev/null +++ b/src/services/common/container.ts @@ -0,0 +1,93 @@ +import { z } from 'zod'; +import { + containerResourceRequirements, + containerResourceRequirementsRequest, + containerResourceRequirementsResponse, +} from './container-resource-requirements'; +import { containerLogging, containerLoggingRequest, containerLoggingResponse } from './container-logging'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const container = z.lazy(() => { + return z.object({ + image: z.string().min(1).max(1024), + resources: containerResourceRequirements, + command: z.array(z.string()).max(100), + priority: z.string().optional().nullable(), + size: z.number().optional(), + hash: z.string().optional(), + environmentVariables: z.any().optional(), + logging: containerLogging.optional().nullable(), + }); +}); + +/** + * Represents a container + * @typedef {Container} container - Represents a container - Represents a container + * @property {string} + * @property {ContainerResourceRequirements} - Represents a container resource requirements + * @property {string[]} + * @property {ContainerGroupPriority} + * @property {number} + * @property {string} + * @property {any} + * @property {ContainerLogging} + */ +export type Container = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerResponse = z.lazy(() => { + return z + .object({ + image: z.string().min(1).max(1024), + resources: containerResourceRequirementsResponse, + command: z.array(z.string()).max(100), + priority: z.string().optional().nullable(), + size: z.number().optional(), + hash: z.string().optional(), + environment_variables: z.any().optional(), + logging: containerLoggingResponse.optional().nullable(), + }) + .transform((data) => ({ + image: data['image'], + resources: data['resources'], + command: data['command'], + priority: data['priority'], + size: data['size'], + hash: data['hash'], + environmentVariables: data['environment_variables'], + logging: data['logging'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerRequest = z.lazy(() => { + return z + .object({ + image: z.string().nullish(), + resources: containerResourceRequirementsRequest.nullish(), + command: z.array(z.string()).nullish(), + priority: z.string().nullish(), + size: z.number().nullish(), + hash: z.string().nullish(), + environmentVariables: z.any().nullish(), + logging: containerLoggingRequest.nullish(), + }) + .transform((data) => ({ + image: data['image'], + resources: data['resources'], + command: data['command'], + priority: data['priority'], + size: data['size'], + hash: data['hash'], + environment_variables: data['environmentVariables'], + logging: data['logging'], + })); +}); diff --git a/src/services/common/country-code.ts b/src/services/common/country-code.ts new file mode 100644 index 0000000..5806543 --- /dev/null +++ b/src/services/common/country-code.ts @@ -0,0 +1,253 @@ +import { z } from 'zod'; + +export enum CountryCode { + AF = 'af', + AL = 'al', + DZ = 'dz', + AS_ = 'as', + AD = 'ad', + AO = 'ao', + AI = 'ai', + AQ = 'aq', + AG = 'ag', + AR = 'ar', + AM = 'am', + AW = 'aw', + AU = 'au', + AT = 'at', + AZ = 'az', + BS = 'bs', + BH = 'bh', + BD = 'bd', + BB = 'bb', + BY = 'by', + BE = 'be', + BZ = 'bz', + BJ = 'bj', + BM = 'bm', + BT = 'bt', + BO = 'bo', + BQ = 'bq', + BA = 'ba', + BW = 'bw', + BV = 'bv', + BR = 'br', + IO = 'io', + BN = 'bn', + BG = 'bg', + BF = 'bf', + BI = 'bi', + CV = 'cv', + KH = 'kh', + CM = 'cm', + CA = 'ca', + KY = 'ky', + CF = 'cf', + TD = 'td', + CL = 'cl', + CN = 'cn', + CX = 'cx', + CC = 'cc', + CO = 'co', + KM = 'km', + CD = 'cd', + CG = 'cg', + CK = 'ck', + CR = 'cr', + HR = 'hr', + CU = 'cu', + CW = 'cw', + CY = 'cy', + CZ = 'cz', + CI = 'ci', + DK = 'dk', + DJ = 'dj', + DM = 'dm', + DO_ = 'do', + EC = 'ec', + EG = 'eg', + SV = 'sv', + GQ = 'gq', + ER = 'er', + EE = 'ee', + SZ = 'sz', + ET = 'et', + FK = 'fk', + FO = 'fo', + FJ = 'fj', + FI = 'fi', + FR = 'fr', + GF = 'gf', + PF = 'pf', + TF = 'tf', + GA = 'ga', + GM = 'gm', + GE = 'ge', + DE = 'de', + GH = 'gh', + GI = 'gi', + GR = 'gr', + GL = 'gl', + GD = 'gd', + GP = 'gp', + GU = 'gu', + GT = 'gt', + GG = 'gg', + GN = 'gn', + GW = 'gw', + GY = 'gy', + HT = 'ht', + HM = 'hm', + VA = 'va', + HN = 'hn', + HK = 'hk', + HU = 'hu', + IS = 'is', + IN_ = 'in', + ID = 'id', + IR = 'ir', + IQ = 'iq', + IE = 'ie', + IM = 'im', + IL = 'il', + IT = 'it', + JM = 'jm', + JP = 'jp', + JE = 'je', + JO = 'jo', + KZ = 'kz', + KE = 'ke', + KI = 'ki', + KP = 'kp', + KR = 'kr', + KW = 'kw', + KG = 'kg', + LA = 'la', + LV = 'lv', + LB = 'lb', + LS = 'ls', + LR = 'lr', + LY = 'ly', + LI = 'li', + LT = 'lt', + LU = 'lu', + MO = 'mo', + MG = 'mg', + MW = 'mw', + MY = 'my', + MV = 'mv', + ML = 'ml', + MT = 'mt', + MH = 'mh', + MQ = 'mq', + MR = 'mr', + MU = 'mu', + YT = 'yt', + MX = 'mx', + FM = 'fm', + MD = 'md', + MC = 'mc', + MN = 'mn', + ME = 'me', + MS = 'ms', + MA = 'ma', + MZ = 'mz', + MM = 'mm', + NA = 'na', + NR = 'nr', + NP = 'np', + NL = 'nl', + NC = 'nc', + NZ = 'nz', + NI = 'ni', + NE = 'ne', + NG = 'ng', + NU = 'nu', + NF = 'nf', + MP = 'mp', + NO = 'no', + OM = 'om', + PK = 'pk', + PW = 'pw', + PS = 'ps', + PA = 'pa', + PG = 'pg', + PY = 'py', + PE = 'pe', + PH = 'ph', + PN = 'pn', + PL = 'pl', + PT = 'pt', + PR = 'pr', + QA = 'qa', + MK = 'mk', + RO = 'ro', + RU = 'ru', + RW = 'rw', + RE = 're', + BL = 'bl', + SH = 'sh', + KN = 'kn', + LC = 'lc', + MF = 'mf', + PM = 'pm', + VC = 'vc', + WS = 'ws', + SM = 'sm', + ST = 'st', + SA = 'sa', + SN = 'sn', + RS = 'rs', + SC = 'sc', + SL = 'sl', + SG = 'sg', + SX = 'sx', + SK = 'sk', + SI = 'si', + SB = 'sb', + SO = 'so', + ZA = 'za', + GS = 'gs', + SS = 'ss', + ES = 'es', + LK = 'lk', + SD = 'sd', + SR = 'sr', + SJ = 'sj', + SE = 'se', + CH = 'ch', + SY = 'sy', + TW = 'tw', + TJ = 'tj', + TZ = 'tz', + TH = 'th', + TL = 'tl', + TG = 'tg', + TK = 'tk', + TO = 'to', + TT = 'tt', + TN = 'tn', + TR = 'tr', + TM = 'tm', + TC = 'tc', + TV = 'tv', + UG = 'ug', + UA = 'ua', + AE = 'ae', + GB = 'gb', + UM = 'um', + US = 'us', + UY = 'uy', + UZ = 'uz', + VU = 'vu', + VE = 've', + VN = 'vn', + VG = 'vg', + VI = 'vi', + WF = 'wf', + EH = 'eh', + YE = 'ye', + ZM = 'zm', + ZW = 'zw', + AX = 'ax', +} diff --git a/src/services/common/datadog-tags-1.ts b/src/services/common/datadog-tags-1.ts new file mode 100644 index 0000000..feab838 --- /dev/null +++ b/src/services/common/datadog-tags-1.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const datadogTags1 = z.lazy(() => { + return z.object({ + name: z.string(), + value: z.string(), + }); +}); + +/** + * + * @typedef {DatadogTags1} datadogTags1 + * @property {string} + * @property {string} + */ +export type DatadogTags1 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const datadogTags1Response = z.lazy(() => { + return z + .object({ + name: z.string(), + value: z.string(), + }) + .transform((data) => ({ + name: data['name'], + value: data['value'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const datadogTags1Request = z.lazy(() => { + return z.object({ name: z.string().nullish(), value: z.string().nullish() }).transform((data) => ({ + name: data['name'], + value: data['value'], + })); +}); diff --git a/src/services/common/http-compression-1.ts b/src/services/common/http-compression-1.ts new file mode 100644 index 0000000..5d8b2dc --- /dev/null +++ b/src/services/common/http-compression-1.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; + +export enum HttpCompression1 { + NONE = 'none', + GZIP = 'gzip', +} diff --git a/src/services/common/http-format-1.ts b/src/services/common/http-format-1.ts new file mode 100644 index 0000000..32cb0ad --- /dev/null +++ b/src/services/common/http-format-1.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; + +export enum HttpFormat1 { + JSON = 'json', + JSONLINES = 'json_lines', +} diff --git a/src/services/common/http-headers-1.ts b/src/services/common/http-headers-1.ts new file mode 100644 index 0000000..1129c42 --- /dev/null +++ b/src/services/common/http-headers-1.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const httpHeaders1 = z.lazy(() => { + return z.object({ + name: z.string(), + value: z.string(), + }); +}); + +/** + * + * @typedef {HttpHeaders1} httpHeaders1 + * @property {string} + * @property {string} + */ +export type HttpHeaders1 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const httpHeaders1Response = z.lazy(() => { + return z + .object({ + name: z.string(), + value: z.string(), + }) + .transform((data) => ({ + name: data['name'], + value: data['value'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const httpHeaders1Request = z.lazy(() => { + return z.object({ name: z.string().nullish(), value: z.string().nullish() }).transform((data) => ({ + name: data['name'], + value: data['value'], + })); +}); diff --git a/src/services/common/index.ts b/src/services/common/index.ts new file mode 100644 index 0000000..5cf66da --- /dev/null +++ b/src/services/common/index.ts @@ -0,0 +1,32 @@ +export type { ContainerGroup } from './container-group'; +export type { Container } from './container'; +export { ContainerRestartPolicy } from './container-restart-policy'; +export type { ContainerGroupState } from './container-group-state'; +export { CountryCode } from './country-code'; +export type { ContainerGroupNetworking } from './container-group-networking'; +export type { ContainerGroupLivenessProbe } from './container-group-liveness-probe'; +export type { ContainerGroupReadinessProbe } from './container-group-readiness-probe'; +export type { ContainerGroupStartupProbe } from './container-group-startup-probe'; +export type { ContainerGroupQueueConnection } from './container-group-queue-connection'; +export type { ContainerResourceRequirements } from './container-resource-requirements'; +export { ContainerGroupPriority } from './container-group-priority'; +export type { ContainerLogging } from './container-logging'; +export type { LoggingAxiom1 } from './logging-axiom-1'; +export type { LoggingDatadog1 } from './logging-datadog-1'; +export type { LoggingNewRelic1 } from './logging-new-relic-1'; +export type { LoggingSplunk1 } from './logging-splunk-1'; +export type { LoggingTcp1 } from './logging-tcp-1'; +export type { LoggingHttp1 } from './logging-http-1'; +export type { DatadogTags1 } from './datadog-tags-1'; +export { HttpFormat1 } from './http-format-1'; +export type { HttpHeaders1 } from './http-headers-1'; +export { HttpCompression1 } from './http-compression-1'; +export { ContainerGroupStatus } from './container-group-status'; +export type { ContainerGroupInstanceStatusCount } from './container-group-instance-status-count'; +export { ContainerNetworkingProtocol } from './container-networking-protocol'; +export type { ContainerGroupProbeTcp } from './container-group-probe-tcp'; +export type { ContainerGroupProbeHttp } from './container-group-probe-http'; +export type { ContainerGroupProbeGrpc } from './container-group-probe-grpc'; +export type { ContainerGroupProbeExec } from './container-group-probe-exec'; +export { ContainerProbeHttpScheme } from './container-probe-http-scheme'; +export type { ContainerGroupProbeHttpHeaders2 } from './container-group-probe-http-headers-2'; diff --git a/src/services/common/logging-axiom-1.ts b/src/services/common/logging-axiom-1.ts new file mode 100644 index 0000000..a3939ec --- /dev/null +++ b/src/services/common/logging-axiom-1.ts @@ -0,0 +1,53 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingAxiom1 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + apiToken: z.string().min(1).max(1000), + dataset: z.string().min(1).max(1000), + }); +}); + +/** + * + * @typedef {LoggingAxiom1} loggingAxiom1 + * @property {string} + * @property {string} + * @property {string} + */ +export type LoggingAxiom1 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingAxiom1Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + api_token: z.string().min(1).max(1000), + dataset: z.string().min(1).max(1000), + }) + .transform((data) => ({ + host: data['host'], + apiToken: data['api_token'], + dataset: data['dataset'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingAxiom1Request = z.lazy(() => { + return z + .object({ host: z.string().nullish(), apiToken: z.string().nullish(), dataset: z.string().nullish() }) + .transform((data) => ({ + host: data['host'], + api_token: data['apiToken'], + dataset: data['dataset'], + })); +}); diff --git a/src/services/common/logging-datadog-1.ts b/src/services/common/logging-datadog-1.ts new file mode 100644 index 0000000..7b4e720 --- /dev/null +++ b/src/services/common/logging-datadog-1.ts @@ -0,0 +1,54 @@ +import { z } from 'zod'; +import { datadogTags1, datadogTags1Request, datadogTags1Response } from './datadog-tags-1'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingDatadog1 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + apiKey: z.string().min(1).max(1000), + tags: z.array(datadogTags1).max(1000).optional().nullable(), + }); +}); + +/** + * + * @typedef {LoggingDatadog1} loggingDatadog1 + * @property {string} + * @property {string} + * @property {DatadogTags1[]} + */ +export type LoggingDatadog1 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingDatadog1Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + api_key: z.string().min(1).max(1000), + tags: z.array(datadogTags1Response).max(1000).optional().nullable(), + }) + .transform((data) => ({ + host: data['host'], + apiKey: data['api_key'], + tags: data['tags'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingDatadog1Request = z.lazy(() => { + return z + .object({ host: z.string().nullish(), apiKey: z.string().nullish(), tags: z.array(datadogTags1Request).nullish() }) + .transform((data) => ({ + host: data['host'], + api_key: data['apiKey'], + tags: data['tags'], + })); +}); diff --git a/src/services/common/logging-http-1.ts b/src/services/common/logging-http-1.ts new file mode 100644 index 0000000..94ab302 --- /dev/null +++ b/src/services/common/logging-http-1.ts @@ -0,0 +1,88 @@ +import { z } from 'zod'; +import { httpHeaders1, httpHeaders1Request, httpHeaders1Response } from './http-headers-1'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingHttp1 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + port: z.number().gte(1).lte(65535), + user: z.string().optional().nullable(), + password: z.string().optional().nullable(), + path: z.string().optional().nullable(), + format: z.string(), + headers: z.array(httpHeaders1).max(1000).optional().nullable(), + compression: z.string(), + }); +}); + +/** + * + * @typedef {LoggingHttp1} loggingHttp1 + * @property {string} + * @property {number} + * @property {string} + * @property {string} + * @property {string} + * @property {HttpFormat1} + * @property {HttpHeaders1[]} + * @property {HttpCompression1} + */ +export type LoggingHttp1 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingHttp1Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + port: z.number().gte(1).lte(65535), + user: z.string().optional().nullable(), + password: z.string().optional().nullable(), + path: z.string().optional().nullable(), + format: z.string(), + headers: z.array(httpHeaders1Response).max(1000).optional().nullable(), + compression: z.string(), + }) + .transform((data) => ({ + host: data['host'], + port: data['port'], + user: data['user'], + password: data['password'], + path: data['path'], + format: data['format'], + headers: data['headers'], + compression: data['compression'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingHttp1Request = z.lazy(() => { + return z + .object({ + host: z.string().nullish(), + port: z.number().nullish(), + user: z.string().nullish(), + password: z.string().nullish(), + path: z.string().nullish(), + format: z.string().nullish(), + headers: z.array(httpHeaders1Request).nullish(), + compression: z.string().nullish(), + }) + .transform((data) => ({ + host: data['host'], + port: data['port'], + user: data['user'], + password: data['password'], + path: data['path'], + format: data['format'], + headers: data['headers'], + compression: data['compression'], + })); +}); diff --git a/src/services/common/logging-new-relic-1.ts b/src/services/common/logging-new-relic-1.ts new file mode 100644 index 0000000..df4e8d9 --- /dev/null +++ b/src/services/common/logging-new-relic-1.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingNewRelic1 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + ingestionKey: z.string().min(1).max(1000), + }); +}); + +/** + * + * @typedef {LoggingNewRelic1} loggingNewRelic1 + * @property {string} + * @property {string} + */ +export type LoggingNewRelic1 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingNewRelic1Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + ingestion_key: z.string().min(1).max(1000), + }) + .transform((data) => ({ + host: data['host'], + ingestionKey: data['ingestion_key'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingNewRelic1Request = z.lazy(() => { + return z.object({ host: z.string().nullish(), ingestionKey: z.string().nullish() }).transform((data) => ({ + host: data['host'], + ingestion_key: data['ingestionKey'], + })); +}); diff --git a/src/services/common/logging-splunk-1.ts b/src/services/common/logging-splunk-1.ts new file mode 100644 index 0000000..656f116 --- /dev/null +++ b/src/services/common/logging-splunk-1.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingSplunk1 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + token: z.string().min(1).max(1000), + }); +}); + +/** + * + * @typedef {LoggingSplunk1} loggingSplunk1 + * @property {string} + * @property {string} + */ +export type LoggingSplunk1 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingSplunk1Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + token: z.string().min(1).max(1000), + }) + .transform((data) => ({ + host: data['host'], + token: data['token'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingSplunk1Request = z.lazy(() => { + return z.object({ host: z.string().nullish(), token: z.string().nullish() }).transform((data) => ({ + host: data['host'], + token: data['token'], + })); +}); diff --git a/src/services/common/logging-tcp-1.ts b/src/services/common/logging-tcp-1.ts new file mode 100644 index 0000000..b2a21a8 --- /dev/null +++ b/src/services/common/logging-tcp-1.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingTcp1 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + port: z.number().gte(1).lte(65535), + }); +}); + +/** + * + * @typedef {LoggingTcp1} loggingTcp1 + * @property {string} + * @property {number} + */ +export type LoggingTcp1 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingTcp1Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + port: z.number().gte(1).lte(65535), + }) + .transform((data) => ({ + host: data['host'], + port: data['port'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingTcp1Request = z.lazy(() => { + return z.object({ host: z.string().nullish(), port: z.number().nullish() }).transform((data) => ({ + host: data['host'], + port: data['port'], + })); +}); diff --git a/src/services/container-groups/container-groups.ts b/src/services/container-groups/container-groups.ts new file mode 100644 index 0000000..cde810f --- /dev/null +++ b/src/services/container-groups/container-groups.ts @@ -0,0 +1,531 @@ +import { z } from 'zod'; +import { BaseService } from '../base-service'; +import { ContentType, HttpResponse, RequestConfig } from '../../http/types'; +import { RequestBuilder } from '../../http/transport/request-builder'; +import { SerializationStyle } from '../../http/serialization/base-serializer'; +import { ContainerGroupList, containerGroupListResponse } from './models/container-group-list'; +import { CreateContainerGroup, createContainerGroupRequest } from './models/create-container-group'; +import { ContainerGroup, containerGroupResponse } from '../common/container-group'; +import { UpdateContainerGroup, updateContainerGroupRequest } from './models/update-container-group'; +import { ContainerGroupInstances, containerGroupInstancesResponse } from './models/container-group-instances'; +import { ContainerGroupInstance, containerGroupInstanceResponse } from './models/container-group-instance'; + +export class ContainerGroupsService extends BaseService { + /** + * Gets the list of container groups + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @returns {Promise>} OK + */ + async listContainerGroups( + organizationName: string, + projectName: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath('/organizations/{organization_name}/projects/{project_name}/containers') + .setRequestSchema(z.any()) + .setResponseSchema(containerGroupListResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .build(); + return this.client.call(request); + } + + /** + * Creates a new container group + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @returns {Promise>} Created + */ + async createContainerGroup( + organizationName: string, + projectName: string, + body: CreateContainerGroup, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('POST') + .setPath('/organizations/{organization_name}/projects/{project_name}/containers') + .setRequestSchema(createContainerGroupRequest) + .setResponseSchema(containerGroupResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) + .addBody(body) + .build(); + return this.client.call(request); + } + + /** + * Gets a container group + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} containerGroupName - The unique container group name + * @returns {Promise>} OK + */ + async getContainerGroup( + organizationName: string, + projectName: string, + containerGroupName: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath('/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}') + .setRequestSchema(z.any()) + .setResponseSchema(containerGroupResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'container_group_name', + value: containerGroupName, + }) + .build(); + return this.client.call(request); + } + + /** + * Updates a container group + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} containerGroupName - The unique container group name + * @returns {Promise>} OK + */ + async updateContainerGroup( + organizationName: string, + projectName: string, + containerGroupName: string, + body: UpdateContainerGroup, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('PATCH') + .setPath('/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}') + .setRequestSchema(updateContainerGroupRequest) + .setResponseSchema(containerGroupResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'container_group_name', + value: containerGroupName, + }) + .addHeaderParam({ key: 'Content-Type', value: 'application/merge-patch+json' }) + .addBody(body) + .build(); + return this.client.call(request); + } + + /** + * Deletes a container group + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} containerGroupName - The unique container group name + * @returns {Promise>} Accepted + */ + async deleteContainerGroup( + organizationName: string, + projectName: string, + containerGroupName: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('DELETE') + .setPath('/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}') + .setRequestSchema(z.any()) + .setResponseSchema(z.undefined()) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'container_group_name', + value: containerGroupName, + }) + .build(); + return this.client.call(request); + } + + /** + * Starts a container group + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} containerGroupName - The unique container group name + * @returns {Promise>} Accepted + */ + async startContainerGroup( + organizationName: string, + projectName: string, + containerGroupName: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('POST') + .setPath('/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/start') + .setRequestSchema(z.any()) + .setResponseSchema(z.undefined()) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'container_group_name', + value: containerGroupName, + }) + .build(); + return this.client.call(request); + } + + /** + * Stops a container group + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} containerGroupName - The unique container group name + * @returns {Promise>} Accepted + */ + async stopContainerGroup( + organizationName: string, + projectName: string, + containerGroupName: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('POST') + .setPath('/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/stop') + .setRequestSchema(z.any()) + .setResponseSchema(z.undefined()) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'container_group_name', + value: containerGroupName, + }) + .build(); + return this.client.call(request); + } + + /** + * Retrieves a list of container group instances + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} containerGroupName - The unique container group name + * @returns {Promise>} OK + */ + async listContainerGroupInstances( + organizationName: string, + projectName: string, + containerGroupName: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath('/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances') + .setRequestSchema(z.any()) + .setResponseSchema(containerGroupInstancesResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'container_group_name', + value: containerGroupName, + }) + .build(); + return this.client.call(request); + } + + /** + * Retrieves the details of a single instance within a container group by instance ID + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} containerGroupName - The unique container group name + * @param {string} containerGroupInstanceId - The unique instance identifier + * @returns {Promise>} OK + */ + async getContainerGroupInstance( + organizationName: string, + projectName: string, + containerGroupName: string, + containerGroupInstanceId: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath( + '/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}', + ) + .setRequestSchema(z.any()) + .setResponseSchema(containerGroupInstanceResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'container_group_name', + value: containerGroupName, + }) + .addPathParam({ + key: 'container_group_instance_id', + value: containerGroupInstanceId, + }) + .build(); + return this.client.call(request); + } + + /** + * Remove a node from a workload and reallocate the workload to a different node + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} containerGroupName - The unique container group name + * @param {string} containerGroupInstanceId - The unique instance identifier + * @returns {Promise>} Accepted + */ + async reallocateContainerGroupInstance( + organizationName: string, + projectName: string, + containerGroupName: string, + containerGroupInstanceId: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('POST') + .setPath( + '/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}/reallocate', + ) + .setRequestSchema(z.any()) + .setResponseSchema(z.undefined()) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'container_group_name', + value: containerGroupName, + }) + .addPathParam({ + key: 'container_group_instance_id', + value: containerGroupInstanceId, + }) + .build(); + return this.client.call(request); + } + + /** + * Stops a container, destroys it, creates a new one without requiring the image to be downloaded again on a different node + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} containerGroupName - The unique container group name + * @param {string} containerGroupInstanceId - The unique instance identifier + * @returns {Promise>} Accepted + */ + async recreateContainerGroupInstance( + organizationName: string, + projectName: string, + containerGroupName: string, + containerGroupInstanceId: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('POST') + .setPath( + '/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}/recreate', + ) + .setRequestSchema(z.any()) + .setResponseSchema(z.undefined()) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'container_group_name', + value: containerGroupName, + }) + .addPathParam({ + key: 'container_group_instance_id', + value: containerGroupInstanceId, + }) + .build(); + return this.client.call(request); + } + + /** + * Restarts a workload on a node without reallocating it + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} containerGroupName - The unique container group name + * @param {string} containerGroupInstanceId - The unique instance identifier + * @returns {Promise>} Accepted + */ + async restartContainerGroupInstance( + organizationName: string, + projectName: string, + containerGroupName: string, + containerGroupInstanceId: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('POST') + .setPath( + '/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id}/restart', + ) + .setRequestSchema(z.any()) + .setResponseSchema(z.undefined()) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'container_group_name', + value: containerGroupName, + }) + .addPathParam({ + key: 'container_group_instance_id', + value: containerGroupInstanceId, + }) + .build(); + return this.client.call(request); + } +} diff --git a/src/services/container-groups/index.ts b/src/services/container-groups/index.ts new file mode 100644 index 0000000..a0debc1 --- /dev/null +++ b/src/services/container-groups/index.ts @@ -0,0 +1,2 @@ +export { ContainerGroupsService } from './container-groups'; +export * from './models'; diff --git a/src/services/container-groups/models/container-group-instance.ts b/src/services/container-groups/models/container-group-instance.ts new file mode 100644 index 0000000..b9ae39e --- /dev/null +++ b/src/services/container-groups/models/container-group-instance.ts @@ -0,0 +1,81 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupInstance = z.lazy(() => { + return z.object({ + instanceId: z.string(), + machineId: z.string(), + state: z.string(), + updateTime: z.string(), + version: z.number().gte(1), + ready: z.boolean().optional(), + started: z.boolean().optional(), + }); +}); + +/** + * Represents the details of a single container group instance + * @typedef {ContainerGroupInstance} containerGroupInstance - Represents the details of a single container group instance - Represents the details of a single container group instance + * @property {string} - The unique instance ID + * @property {string} - The machine ID + * @property {State} - The state of the container group instance + * @property {string} - The UTC date & time when the workload on this machine transitioned to the current state + * @property {number} - The version of the running container group + * @property {boolean} - Specifies whether the container group instance is currently passing its readiness check. If no readiness probe is defined, is true once fully started. + * @property {boolean} - Specifies whether the container group instance passed its startup probe. Is always true when no startup probe is defined. + */ +export type ContainerGroupInstance = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupInstanceResponse = z.lazy(() => { + return z + .object({ + instance_id: z.string(), + machine_id: z.string(), + state: z.string(), + update_time: z.string(), + version: z.number().gte(1), + ready: z.boolean().optional(), + started: z.boolean().optional(), + }) + .transform((data) => ({ + instanceId: data['instance_id'], + machineId: data['machine_id'], + state: data['state'], + updateTime: data['update_time'], + version: data['version'], + ready: data['ready'], + started: data['started'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupInstanceRequest = z.lazy(() => { + return z + .object({ + instanceId: z.string().nullish(), + machineId: z.string().nullish(), + state: z.string().nullish(), + updateTime: z.string().nullish(), + version: z.number().nullish(), + ready: z.boolean().nullish(), + started: z.boolean().nullish(), + }) + .transform((data) => ({ + instance_id: data['instanceId'], + machine_id: data['machineId'], + state: data['state'], + update_time: data['updateTime'], + version: data['version'], + ready: data['ready'], + started: data['started'], + })); +}); diff --git a/src/services/container-groups/models/container-group-instances.ts b/src/services/container-groups/models/container-group-instances.ts new file mode 100644 index 0000000..301ad56 --- /dev/null +++ b/src/services/container-groups/models/container-group-instances.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; +import { + containerGroupInstance, + containerGroupInstanceRequest, + containerGroupInstanceResponse, +} from './container-group-instance'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupInstances = z.lazy(() => { + return z.object({ + instances: z.array(containerGroupInstance).max(1000), + }); +}); + +/** + * Represents a list of container group instances + * @typedef {ContainerGroupInstances} containerGroupInstances - Represents a list of container group instances - Represents a list of container group instances + * @property {ContainerGroupInstance[]} + */ +export type ContainerGroupInstances = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupInstancesResponse = z.lazy(() => { + return z + .object({ + instances: z.array(containerGroupInstanceResponse).max(1000), + }) + .transform((data) => ({ + instances: data['instances'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupInstancesRequest = z.lazy(() => { + return z.object({ instances: z.array(containerGroupInstanceRequest).nullish() }).transform((data) => ({ + instances: data['instances'], + })); +}); diff --git a/src/services/container-groups/models/container-group-list.ts b/src/services/container-groups/models/container-group-list.ts new file mode 100644 index 0000000..8787f27 --- /dev/null +++ b/src/services/container-groups/models/container-group-list.ts @@ -0,0 +1,42 @@ +import { z } from 'zod'; +import { containerGroup, containerGroupRequest, containerGroupResponse } from '../../common/container-group'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupList = z.lazy(() => { + return z.object({ + items: z.array(containerGroup).max(100), + }); +}); + +/** + * Represents a list of container groups + * @typedef {ContainerGroupList} containerGroupList - Represents a list of container groups - Represents a list of container groups + * @property {ContainerGroup[]} + */ +export type ContainerGroupList = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupListResponse = z.lazy(() => { + return z + .object({ + items: z.array(containerGroupResponse).max(100), + }) + .transform((data) => ({ + items: data['items'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupListRequest = z.lazy(() => { + return z.object({ items: z.array(containerGroupRequest).nullish() }).transform((data) => ({ + items: data['items'], + })); +}); diff --git a/src/services/container-groups/models/create-container-group-networking.ts b/src/services/container-groups/models/create-container-group-networking.ts new file mode 100644 index 0000000..5dda003 --- /dev/null +++ b/src/services/container-groups/models/create-container-group-networking.ts @@ -0,0 +1,53 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const createContainerGroupNetworking = z.lazy(() => { + return z.object({ + protocol: z.string(), + port: z.number().gte(1).lte(65535), + auth: z.boolean(), + }); +}); + +/** + * Represents container group networking parameters + * @typedef {CreateContainerGroupNetworking} createContainerGroupNetworking - Represents container group networking parameters - Represents container group networking parameters + * @property {ContainerNetworkingProtocol} + * @property {number} + * @property {boolean} + */ +export type CreateContainerGroupNetworking = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const createContainerGroupNetworkingResponse = z.lazy(() => { + return z + .object({ + protocol: z.string(), + port: z.number().gte(1).lte(65535), + auth: z.boolean(), + }) + .transform((data) => ({ + protocol: data['protocol'], + port: data['port'], + auth: data['auth'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const createContainerGroupNetworkingRequest = z.lazy(() => { + return z + .object({ protocol: z.string().nullish(), port: z.number().nullish(), auth: z.boolean().nullish() }) + .transform((data) => ({ + protocol: data['protocol'], + port: data['port'], + auth: data['auth'], + })); +}); diff --git a/src/services/container-groups/models/create-container-group.ts b/src/services/container-groups/models/create-container-group.ts new file mode 100644 index 0000000..3912f45 --- /dev/null +++ b/src/services/container-groups/models/create-container-group.ts @@ -0,0 +1,157 @@ +import { z } from 'zod'; +import { createContainer, createContainerRequest, createContainerResponse } from './create-container'; +import { + createContainerGroupNetworking, + createContainerGroupNetworkingRequest, + createContainerGroupNetworkingResponse, +} from './create-container-group-networking'; +import { + containerGroupLivenessProbe, + containerGroupLivenessProbeRequest, + containerGroupLivenessProbeResponse, +} from '../../common/container-group-liveness-probe'; +import { + containerGroupReadinessProbe, + containerGroupReadinessProbeRequest, + containerGroupReadinessProbeResponse, +} from '../../common/container-group-readiness-probe'; +import { + containerGroupStartupProbe, + containerGroupStartupProbeRequest, + containerGroupStartupProbeResponse, +} from '../../common/container-group-startup-probe'; +import { + containerGroupQueueConnection, + containerGroupQueueConnectionRequest, + containerGroupQueueConnectionResponse, +} from '../../common/container-group-queue-connection'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const createContainerGroup = z.lazy(() => { + return z.object({ + name: z + .string() + .min(2) + .max(63) + .regex(/^[a-z][a-z0-9-]{0,61}[a-z0-9]$/), + displayName: z + .string() + .min(2) + .max(63) + .regex(/^[ ,-.0-9A-Za-z]+$/) + .optional() + .nullable(), + container: createContainer, + autostartPolicy: z.boolean(), + restartPolicy: z.string(), + replicas: z.number().gte(0).lte(250), + countryCodes: z.array(z.string()).min(1).max(500).optional(), + networking: createContainerGroupNetworking.optional().nullable(), + livenessProbe: containerGroupLivenessProbe.optional().nullable(), + readinessProbe: containerGroupReadinessProbe.optional().nullable(), + startupProbe: containerGroupStartupProbe.optional().nullable(), + queueConnection: containerGroupQueueConnection.optional().nullable(), + }); +}); + +/** + * Represents a request to create a container group + * @typedef {CreateContainerGroup} createContainerGroup - Represents a request to create a container group - Represents a request to create a container group + * @property {string} + * @property {string} + * @property {CreateContainer} - Represents a container + * @property {boolean} + * @property {ContainerRestartPolicy} + * @property {number} + * @property {CountryCode[]} - List of countries nodes must be located in. Remove this field to permit nodes from any country. + * @property {CreateContainerGroupNetworking} - Represents container group networking parameters + * @property {ContainerGroupLivenessProbe} - Represents the container group liveness probe + * @property {ContainerGroupReadinessProbe} - Represents the container group readiness probe + * @property {ContainerGroupStartupProbe} - Represents the container group startup probe + * @property {ContainerGroupQueueConnection} - Represents container group queue connection + */ +export type CreateContainerGroup = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const createContainerGroupResponse = z.lazy(() => { + return z + .object({ + name: z + .string() + .min(2) + .max(63) + .regex(/^[a-z][a-z0-9-]{0,61}[a-z0-9]$/), + display_name: z + .string() + .min(2) + .max(63) + .regex(/^[ ,-.0-9A-Za-z]+$/) + .optional() + .nullable(), + container: createContainerResponse, + autostart_policy: z.boolean(), + restart_policy: z.string(), + replicas: z.number().gte(0).lte(250), + country_codes: z.array(z.string()).min(1).max(500).optional(), + networking: createContainerGroupNetworkingResponse.optional().nullable(), + liveness_probe: containerGroupLivenessProbeResponse.optional().nullable(), + readiness_probe: containerGroupReadinessProbeResponse.optional().nullable(), + startup_probe: containerGroupStartupProbeResponse.optional().nullable(), + queue_connection: containerGroupQueueConnectionResponse.optional().nullable(), + }) + .transform((data) => ({ + name: data['name'], + displayName: data['display_name'], + container: data['container'], + autostartPolicy: data['autostart_policy'], + restartPolicy: data['restart_policy'], + replicas: data['replicas'], + countryCodes: data['country_codes'], + networking: data['networking'], + livenessProbe: data['liveness_probe'], + readinessProbe: data['readiness_probe'], + startupProbe: data['startup_probe'], + queueConnection: data['queue_connection'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const createContainerGroupRequest = z.lazy(() => { + return z + .object({ + name: z.string().nullish(), + displayName: z.string().nullish(), + container: createContainerRequest.nullish(), + autostartPolicy: z.boolean().nullish(), + restartPolicy: z.string().nullish(), + replicas: z.number().nullish(), + countryCodes: z.array(z.string()).nullish(), + networking: createContainerGroupNetworkingRequest.nullish(), + livenessProbe: containerGroupLivenessProbeRequest.nullish(), + readinessProbe: containerGroupReadinessProbeRequest.nullish(), + startupProbe: containerGroupStartupProbeRequest.nullish(), + queueConnection: containerGroupQueueConnectionRequest.nullish(), + }) + .transform((data) => ({ + name: data['name'], + display_name: data['displayName'], + container: data['container'], + autostart_policy: data['autostartPolicy'], + restart_policy: data['restartPolicy'], + replicas: data['replicas'], + country_codes: data['countryCodes'], + networking: data['networking'], + liveness_probe: data['livenessProbe'], + readiness_probe: data['readinessProbe'], + startup_probe: data['startupProbe'], + queue_connection: data['queueConnection'], + })); +}); diff --git a/src/services/container-groups/models/create-container-logging.ts b/src/services/container-groups/models/create-container-logging.ts new file mode 100644 index 0000000..70f21ec --- /dev/null +++ b/src/services/container-groups/models/create-container-logging.ts @@ -0,0 +1,81 @@ +import { z } from 'zod'; +import { loggingAxiom2, loggingAxiom2Request, loggingAxiom2Response } from './logging-axiom-2'; +import { loggingDatadog2, loggingDatadog2Request, loggingDatadog2Response } from './logging-datadog-2'; +import { loggingNewRelic2, loggingNewRelic2Request, loggingNewRelic2Response } from './logging-new-relic-2'; +import { loggingSplunk2, loggingSplunk2Request, loggingSplunk2Response } from './logging-splunk-2'; +import { loggingTcp2, loggingTcp2Request, loggingTcp2Response } from './logging-tcp-2'; +import { loggingHttp2, loggingHttp2Request, loggingHttp2Response } from './logging-http-2'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const createContainerLogging = z.lazy(() => { + return z.object({ + axiom: loggingAxiom2.optional().nullable(), + datadog: loggingDatadog2.optional().nullable(), + newRelic: loggingNewRelic2.optional().nullable(), + splunk: loggingSplunk2.optional().nullable(), + tcp: loggingTcp2.optional().nullable(), + http: loggingHttp2.optional().nullable(), + }); +}); + +/** + * + * @typedef {CreateContainerLogging} createContainerLogging + * @property {LoggingAxiom2} + * @property {LoggingDatadog2} + * @property {LoggingNewRelic2} + * @property {LoggingSplunk2} + * @property {LoggingTcp2} + * @property {LoggingHttp2} + */ +export type CreateContainerLogging = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const createContainerLoggingResponse = z.lazy(() => { + return z + .object({ + axiom: loggingAxiom2Response.optional().nullable(), + datadog: loggingDatadog2Response.optional().nullable(), + new_relic: loggingNewRelic2Response.optional().nullable(), + splunk: loggingSplunk2Response.optional().nullable(), + tcp: loggingTcp2Response.optional().nullable(), + http: loggingHttp2Response.optional().nullable(), + }) + .transform((data) => ({ + axiom: data['axiom'], + datadog: data['datadog'], + newRelic: data['new_relic'], + splunk: data['splunk'], + tcp: data['tcp'], + http: data['http'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const createContainerLoggingRequest = z.lazy(() => { + return z + .object({ + axiom: loggingAxiom2Request.nullish(), + datadog: loggingDatadog2Request.nullish(), + newRelic: loggingNewRelic2Request.nullish(), + splunk: loggingSplunk2Request.nullish(), + tcp: loggingTcp2Request.nullish(), + http: loggingHttp2Request.nullish(), + }) + .transform((data) => ({ + axiom: data['axiom'], + datadog: data['datadog'], + new_relic: data['newRelic'], + splunk: data['splunk'], + tcp: data['tcp'], + http: data['http'], + })); +}); diff --git a/src/services/container-groups/models/create-container-registry-authentication.ts b/src/services/container-groups/models/create-container-registry-authentication.ts new file mode 100644 index 0000000..5e5a22c --- /dev/null +++ b/src/services/container-groups/models/create-container-registry-authentication.ts @@ -0,0 +1,94 @@ +import { z } from 'zod'; +import { + registryAuthenticationBasic1, + registryAuthenticationBasic1Request, + registryAuthenticationBasic1Response, +} from './registry-authentication-basic-1'; +import { + registryAuthenticationGcpGcr1, + registryAuthenticationGcpGcr1Request, + registryAuthenticationGcpGcr1Response, +} from './registry-authentication-gcp-gcr-1'; +import { + registryAuthenticationAwsEcr1, + registryAuthenticationAwsEcr1Request, + registryAuthenticationAwsEcr1Response, +} from './registry-authentication-aws-ecr-1'; +import { + registryAuthenticationDockerHub1, + registryAuthenticationDockerHub1Request, + registryAuthenticationDockerHub1Response, +} from './registry-authentication-docker-hub-1'; +import { + registryAuthenticationGcpGar1, + registryAuthenticationGcpGar1Request, + registryAuthenticationGcpGar1Response, +} from './registry-authentication-gcp-gar-1'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const createContainerRegistryAuthentication = z.lazy(() => { + return z.object({ + basic: registryAuthenticationBasic1.optional().nullable(), + gcpGcr: registryAuthenticationGcpGcr1.optional().nullable(), + awsEcr: registryAuthenticationAwsEcr1.optional().nullable(), + dockerHub: registryAuthenticationDockerHub1.optional().nullable(), + gcpGar: registryAuthenticationGcpGar1.optional().nullable(), + }); +}); + +/** + * + * @typedef {CreateContainerRegistryAuthentication} createContainerRegistryAuthentication + * @property {RegistryAuthenticationBasic1} + * @property {RegistryAuthenticationGcpGcr1} + * @property {RegistryAuthenticationAwsEcr1} + * @property {RegistryAuthenticationDockerHub1} + * @property {RegistryAuthenticationGcpGar1} + */ +export type CreateContainerRegistryAuthentication = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const createContainerRegistryAuthenticationResponse = z.lazy(() => { + return z + .object({ + basic: registryAuthenticationBasic1Response.optional().nullable(), + gcp_gcr: registryAuthenticationGcpGcr1Response.optional().nullable(), + aws_ecr: registryAuthenticationAwsEcr1Response.optional().nullable(), + docker_hub: registryAuthenticationDockerHub1Response.optional().nullable(), + gcp_gar: registryAuthenticationGcpGar1Response.optional().nullable(), + }) + .transform((data) => ({ + basic: data['basic'], + gcpGcr: data['gcp_gcr'], + awsEcr: data['aws_ecr'], + dockerHub: data['docker_hub'], + gcpGar: data['gcp_gar'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const createContainerRegistryAuthenticationRequest = z.lazy(() => { + return z + .object({ + basic: registryAuthenticationBasic1Request.nullish(), + gcpGcr: registryAuthenticationGcpGcr1Request.nullish(), + awsEcr: registryAuthenticationAwsEcr1Request.nullish(), + dockerHub: registryAuthenticationDockerHub1Request.nullish(), + gcpGar: registryAuthenticationGcpGar1Request.nullish(), + }) + .transform((data) => ({ + basic: data['basic'], + gcp_gcr: data['gcpGcr'], + aws_ecr: data['awsEcr'], + docker_hub: data['dockerHub'], + gcp_gar: data['gcpGar'], + })); +}); diff --git a/src/services/container-groups/models/create-container.ts b/src/services/container-groups/models/create-container.ts new file mode 100644 index 0000000..ef070cc --- /dev/null +++ b/src/services/container-groups/models/create-container.ts @@ -0,0 +1,96 @@ +import { z } from 'zod'; +import { + containerResourceRequirements, + containerResourceRequirementsRequest, + containerResourceRequirementsResponse, +} from '../../common/container-resource-requirements'; +import { + createContainerLogging, + createContainerLoggingRequest, + createContainerLoggingResponse, +} from './create-container-logging'; +import { + createContainerRegistryAuthentication, + createContainerRegistryAuthenticationRequest, + createContainerRegistryAuthenticationResponse, +} from './create-container-registry-authentication'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const createContainer = z.lazy(() => { + return z.object({ + image: z.string().min(1).max(1024), + resources: containerResourceRequirements, + command: z.array(z.string()).max(100).optional().nullable(), + priority: z.string().optional().nullable(), + environmentVariables: z.any().optional(), + logging: createContainerLogging.optional().nullable(), + registryAuthentication: createContainerRegistryAuthentication.optional().nullable(), + }); +}); + +/** + * Represents a container + * @typedef {CreateContainer} createContainer - Represents a container - Represents a container + * @property {string} + * @property {ContainerResourceRequirements} - Represents a container resource requirements + * @property {string[]} - Pass a command (and optional arguments) to override the ENTRYPOINT and CMD of a container image. + * @property {ContainerGroupPriority} + * @property {any} + * @property {CreateContainerLogging} + * @property {CreateContainerRegistryAuthentication} + */ +export type CreateContainer = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const createContainerResponse = z.lazy(() => { + return z + .object({ + image: z.string().min(1).max(1024), + resources: containerResourceRequirementsResponse, + command: z.array(z.string()).max(100).optional().nullable(), + priority: z.string().optional().nullable(), + environment_variables: z.any().optional(), + logging: createContainerLoggingResponse.optional().nullable(), + registry_authentication: createContainerRegistryAuthenticationResponse.optional().nullable(), + }) + .transform((data) => ({ + image: data['image'], + resources: data['resources'], + command: data['command'], + priority: data['priority'], + environmentVariables: data['environment_variables'], + logging: data['logging'], + registryAuthentication: data['registry_authentication'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const createContainerRequest = z.lazy(() => { + return z + .object({ + image: z.string().nullish(), + resources: containerResourceRequirementsRequest.nullish(), + command: z.array(z.string()).nullish(), + priority: z.string().nullish(), + environmentVariables: z.any().nullish(), + logging: createContainerLoggingRequest.nullish(), + registryAuthentication: createContainerRegistryAuthenticationRequest.nullish(), + }) + .transform((data) => ({ + image: data['image'], + resources: data['resources'], + command: data['command'], + priority: data['priority'], + environment_variables: data['environmentVariables'], + logging: data['logging'], + registry_authentication: data['registryAuthentication'], + })); +}); diff --git a/src/services/container-groups/models/datadog-tags-2.ts b/src/services/container-groups/models/datadog-tags-2.ts new file mode 100644 index 0000000..0678612 --- /dev/null +++ b/src/services/container-groups/models/datadog-tags-2.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const datadogTags2 = z.lazy(() => { + return z.object({ + name: z.string(), + value: z.string(), + }); +}); + +/** + * + * @typedef {DatadogTags2} datadogTags2 + * @property {string} + * @property {string} + */ +export type DatadogTags2 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const datadogTags2Response = z.lazy(() => { + return z + .object({ + name: z.string(), + value: z.string(), + }) + .transform((data) => ({ + name: data['name'], + value: data['value'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const datadogTags2Request = z.lazy(() => { + return z.object({ name: z.string().nullish(), value: z.string().nullish() }).transform((data) => ({ + name: data['name'], + value: data['value'], + })); +}); diff --git a/src/services/container-groups/models/datadog-tags-3.ts b/src/services/container-groups/models/datadog-tags-3.ts new file mode 100644 index 0000000..8bb98a3 --- /dev/null +++ b/src/services/container-groups/models/datadog-tags-3.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const datadogTags3 = z.lazy(() => { + return z.object({ + name: z.string(), + value: z.string(), + }); +}); + +/** + * + * @typedef {DatadogTags3} datadogTags3 + * @property {string} + * @property {string} + */ +export type DatadogTags3 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const datadogTags3Response = z.lazy(() => { + return z + .object({ + name: z.string(), + value: z.string(), + }) + .transform((data) => ({ + name: data['name'], + value: data['value'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const datadogTags3Request = z.lazy(() => { + return z.object({ name: z.string().nullish(), value: z.string().nullish() }).transform((data) => ({ + name: data['name'], + value: data['value'], + })); +}); diff --git a/src/services/container-groups/models/http-compression-2.ts b/src/services/container-groups/models/http-compression-2.ts new file mode 100644 index 0000000..db8fc9c --- /dev/null +++ b/src/services/container-groups/models/http-compression-2.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; + +export enum HttpCompression2 { + NONE = 'none', + GZIP = 'gzip', +} diff --git a/src/services/container-groups/models/http-compression-3.ts b/src/services/container-groups/models/http-compression-3.ts new file mode 100644 index 0000000..ef993a1 --- /dev/null +++ b/src/services/container-groups/models/http-compression-3.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; + +export enum HttpCompression3 { + NONE = 'none', + GZIP = 'gzip', +} diff --git a/src/services/container-groups/models/http-format-2.ts b/src/services/container-groups/models/http-format-2.ts new file mode 100644 index 0000000..a9aab98 --- /dev/null +++ b/src/services/container-groups/models/http-format-2.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; + +export enum HttpFormat2 { + JSON = 'json', + JSONLINES = 'json_lines', +} diff --git a/src/services/container-groups/models/http-format-3.ts b/src/services/container-groups/models/http-format-3.ts new file mode 100644 index 0000000..6db9a36 --- /dev/null +++ b/src/services/container-groups/models/http-format-3.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; + +export enum HttpFormat3 { + JSON = 'json', + JSONLINES = 'json_lines', +} diff --git a/src/services/container-groups/models/http-headers-3.ts b/src/services/container-groups/models/http-headers-3.ts new file mode 100644 index 0000000..c67fa2e --- /dev/null +++ b/src/services/container-groups/models/http-headers-3.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const httpHeaders3 = z.lazy(() => { + return z.object({ + name: z.string(), + value: z.string(), + }); +}); + +/** + * + * @typedef {HttpHeaders3} httpHeaders3 + * @property {string} + * @property {string} + */ +export type HttpHeaders3 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const httpHeaders3Response = z.lazy(() => { + return z + .object({ + name: z.string(), + value: z.string(), + }) + .transform((data) => ({ + name: data['name'], + value: data['value'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const httpHeaders3Request = z.lazy(() => { + return z.object({ name: z.string().nullish(), value: z.string().nullish() }).transform((data) => ({ + name: data['name'], + value: data['value'], + })); +}); diff --git a/src/services/container-groups/models/http-headers-4.ts b/src/services/container-groups/models/http-headers-4.ts new file mode 100644 index 0000000..e87ca40 --- /dev/null +++ b/src/services/container-groups/models/http-headers-4.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const httpHeaders4 = z.lazy(() => { + return z.object({ + name: z.string(), + value: z.string(), + }); +}); + +/** + * + * @typedef {HttpHeaders4} httpHeaders4 + * @property {string} + * @property {string} + */ +export type HttpHeaders4 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const httpHeaders4Response = z.lazy(() => { + return z + .object({ + name: z.string(), + value: z.string(), + }) + .transform((data) => ({ + name: data['name'], + value: data['value'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const httpHeaders4Request = z.lazy(() => { + return z.object({ name: z.string().nullish(), value: z.string().nullish() }).transform((data) => ({ + name: data['name'], + value: data['value'], + })); +}); diff --git a/src/services/container-groups/models/index.ts b/src/services/container-groups/models/index.ts new file mode 100644 index 0000000..092e920 --- /dev/null +++ b/src/services/container-groups/models/index.ts @@ -0,0 +1,45 @@ +export type { ContainerGroupList } from './container-group-list'; +export type { CreateContainerGroup } from './create-container-group'; +export type { UpdateContainerGroup } from './update-container-group'; +export type { ContainerGroupInstances } from './container-group-instances'; +export type { ContainerGroupInstance } from './container-group-instance'; +export type { CreateContainer } from './create-container'; +export type { CreateContainerGroupNetworking } from './create-container-group-networking'; +export type { CreateContainerLogging } from './create-container-logging'; +export type { CreateContainerRegistryAuthentication } from './create-container-registry-authentication'; +export type { LoggingAxiom2 } from './logging-axiom-2'; +export type { LoggingDatadog2 } from './logging-datadog-2'; +export type { LoggingNewRelic2 } from './logging-new-relic-2'; +export type { LoggingSplunk2 } from './logging-splunk-2'; +export type { LoggingTcp2 } from './logging-tcp-2'; +export type { LoggingHttp2 } from './logging-http-2'; +export type { DatadogTags2 } from './datadog-tags-2'; +export { HttpFormat2 } from './http-format-2'; +export type { HttpHeaders3 } from './http-headers-3'; +export { HttpCompression2 } from './http-compression-2'; +export type { RegistryAuthenticationBasic1 } from './registry-authentication-basic-1'; +export type { RegistryAuthenticationGcpGcr1 } from './registry-authentication-gcp-gcr-1'; +export type { RegistryAuthenticationAwsEcr1 } from './registry-authentication-aws-ecr-1'; +export type { RegistryAuthenticationDockerHub1 } from './registry-authentication-docker-hub-1'; +export type { RegistryAuthenticationGcpGar1 } from './registry-authentication-gcp-gar-1'; +export type { UpdateContainer } from './update-container'; +export type { UpdateContainerGroupNetworking } from './update-container-group-networking'; +export type { Resources } from './resources'; +export type { UpdateContainerLogging } from './update-container-logging'; +export type { UpdateContainerRegistryAuthentication } from './update-container-registry-authentication'; +export type { LoggingAxiom3 } from './logging-axiom-3'; +export type { LoggingDatadog3 } from './logging-datadog-3'; +export type { LoggingNewRelic3 } from './logging-new-relic-3'; +export type { LoggingSplunk3 } from './logging-splunk-3'; +export type { LoggingTcp3 } from './logging-tcp-3'; +export type { LoggingHttp3 } from './logging-http-3'; +export type { DatadogTags3 } from './datadog-tags-3'; +export { HttpFormat3 } from './http-format-3'; +export type { HttpHeaders4 } from './http-headers-4'; +export { HttpCompression3 } from './http-compression-3'; +export type { RegistryAuthenticationBasic2 } from './registry-authentication-basic-2'; +export type { RegistryAuthenticationGcpGcr2 } from './registry-authentication-gcp-gcr-2'; +export type { RegistryAuthenticationAwsEcr2 } from './registry-authentication-aws-ecr-2'; +export type { RegistryAuthenticationDockerHub2 } from './registry-authentication-docker-hub-2'; +export type { RegistryAuthenticationGcpGar2 } from './registry-authentication-gcp-gar-2'; +export { State } from './state'; diff --git a/src/services/container-groups/models/logging-axiom-2.ts b/src/services/container-groups/models/logging-axiom-2.ts new file mode 100644 index 0000000..caabbee --- /dev/null +++ b/src/services/container-groups/models/logging-axiom-2.ts @@ -0,0 +1,53 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingAxiom2 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + apiToken: z.string().min(1).max(1000), + dataset: z.string().min(1).max(1000), + }); +}); + +/** + * + * @typedef {LoggingAxiom2} loggingAxiom2 + * @property {string} + * @property {string} + * @property {string} + */ +export type LoggingAxiom2 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingAxiom2Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + api_token: z.string().min(1).max(1000), + dataset: z.string().min(1).max(1000), + }) + .transform((data) => ({ + host: data['host'], + apiToken: data['api_token'], + dataset: data['dataset'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingAxiom2Request = z.lazy(() => { + return z + .object({ host: z.string().nullish(), apiToken: z.string().nullish(), dataset: z.string().nullish() }) + .transform((data) => ({ + host: data['host'], + api_token: data['apiToken'], + dataset: data['dataset'], + })); +}); diff --git a/src/services/container-groups/models/logging-axiom-3.ts b/src/services/container-groups/models/logging-axiom-3.ts new file mode 100644 index 0000000..574f86a --- /dev/null +++ b/src/services/container-groups/models/logging-axiom-3.ts @@ -0,0 +1,53 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingAxiom3 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + apiToken: z.string().min(1).max(1000), + dataset: z.string().min(1).max(1000), + }); +}); + +/** + * + * @typedef {LoggingAxiom3} loggingAxiom3 + * @property {string} + * @property {string} + * @property {string} + */ +export type LoggingAxiom3 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingAxiom3Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + api_token: z.string().min(1).max(1000), + dataset: z.string().min(1).max(1000), + }) + .transform((data) => ({ + host: data['host'], + apiToken: data['api_token'], + dataset: data['dataset'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingAxiom3Request = z.lazy(() => { + return z + .object({ host: z.string().nullish(), apiToken: z.string().nullish(), dataset: z.string().nullish() }) + .transform((data) => ({ + host: data['host'], + api_token: data['apiToken'], + dataset: data['dataset'], + })); +}); diff --git a/src/services/container-groups/models/logging-datadog-2.ts b/src/services/container-groups/models/logging-datadog-2.ts new file mode 100644 index 0000000..1729326 --- /dev/null +++ b/src/services/container-groups/models/logging-datadog-2.ts @@ -0,0 +1,54 @@ +import { z } from 'zod'; +import { datadogTags2, datadogTags2Request, datadogTags2Response } from './datadog-tags-2'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingDatadog2 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + apiKey: z.string().min(1).max(1000), + tags: z.array(datadogTags2).max(1000).optional().nullable(), + }); +}); + +/** + * + * @typedef {LoggingDatadog2} loggingDatadog2 + * @property {string} + * @property {string} + * @property {DatadogTags2[]} + */ +export type LoggingDatadog2 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingDatadog2Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + api_key: z.string().min(1).max(1000), + tags: z.array(datadogTags2Response).max(1000).optional().nullable(), + }) + .transform((data) => ({ + host: data['host'], + apiKey: data['api_key'], + tags: data['tags'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingDatadog2Request = z.lazy(() => { + return z + .object({ host: z.string().nullish(), apiKey: z.string().nullish(), tags: z.array(datadogTags2Request).nullish() }) + .transform((data) => ({ + host: data['host'], + api_key: data['apiKey'], + tags: data['tags'], + })); +}); diff --git a/src/services/container-groups/models/logging-datadog-3.ts b/src/services/container-groups/models/logging-datadog-3.ts new file mode 100644 index 0000000..3d87cd2 --- /dev/null +++ b/src/services/container-groups/models/logging-datadog-3.ts @@ -0,0 +1,54 @@ +import { z } from 'zod'; +import { datadogTags3, datadogTags3Request, datadogTags3Response } from './datadog-tags-3'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingDatadog3 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + apiKey: z.string().min(1).max(1000), + tags: z.array(datadogTags3).max(1000).optional().nullable(), + }); +}); + +/** + * + * @typedef {LoggingDatadog3} loggingDatadog3 + * @property {string} + * @property {string} + * @property {DatadogTags3[]} + */ +export type LoggingDatadog3 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingDatadog3Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + api_key: z.string().min(1).max(1000), + tags: z.array(datadogTags3Response).max(1000).optional().nullable(), + }) + .transform((data) => ({ + host: data['host'], + apiKey: data['api_key'], + tags: data['tags'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingDatadog3Request = z.lazy(() => { + return z + .object({ host: z.string().nullish(), apiKey: z.string().nullish(), tags: z.array(datadogTags3Request).nullish() }) + .transform((data) => ({ + host: data['host'], + api_key: data['apiKey'], + tags: data['tags'], + })); +}); diff --git a/src/services/container-groups/models/logging-http-2.ts b/src/services/container-groups/models/logging-http-2.ts new file mode 100644 index 0000000..04f7842 --- /dev/null +++ b/src/services/container-groups/models/logging-http-2.ts @@ -0,0 +1,88 @@ +import { z } from 'zod'; +import { httpHeaders3, httpHeaders3Request, httpHeaders3Response } from './http-headers-3'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingHttp2 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + port: z.number().gte(1).lte(65535), + user: z.string().optional().nullable(), + password: z.string().optional().nullable(), + path: z.string().optional().nullable(), + format: z.string(), + headers: z.array(httpHeaders3).max(1000).optional().nullable(), + compression: z.string(), + }); +}); + +/** + * + * @typedef {LoggingHttp2} loggingHttp2 + * @property {string} + * @property {number} + * @property {string} + * @property {string} + * @property {string} + * @property {HttpFormat2} + * @property {HttpHeaders3[]} + * @property {HttpCompression2} + */ +export type LoggingHttp2 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingHttp2Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + port: z.number().gte(1).lte(65535), + user: z.string().optional().nullable(), + password: z.string().optional().nullable(), + path: z.string().optional().nullable(), + format: z.string(), + headers: z.array(httpHeaders3Response).max(1000).optional().nullable(), + compression: z.string(), + }) + .transform((data) => ({ + host: data['host'], + port: data['port'], + user: data['user'], + password: data['password'], + path: data['path'], + format: data['format'], + headers: data['headers'], + compression: data['compression'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingHttp2Request = z.lazy(() => { + return z + .object({ + host: z.string().nullish(), + port: z.number().nullish(), + user: z.string().nullish(), + password: z.string().nullish(), + path: z.string().nullish(), + format: z.string().nullish(), + headers: z.array(httpHeaders3Request).nullish(), + compression: z.string().nullish(), + }) + .transform((data) => ({ + host: data['host'], + port: data['port'], + user: data['user'], + password: data['password'], + path: data['path'], + format: data['format'], + headers: data['headers'], + compression: data['compression'], + })); +}); diff --git a/src/services/container-groups/models/logging-http-3.ts b/src/services/container-groups/models/logging-http-3.ts new file mode 100644 index 0000000..115350c --- /dev/null +++ b/src/services/container-groups/models/logging-http-3.ts @@ -0,0 +1,88 @@ +import { z } from 'zod'; +import { httpHeaders4, httpHeaders4Request, httpHeaders4Response } from './http-headers-4'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingHttp3 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + port: z.number().gte(1).lte(65535), + user: z.string().optional().nullable(), + password: z.string().optional().nullable(), + path: z.string().optional().nullable(), + format: z.string(), + headers: z.array(httpHeaders4).max(1000).optional().nullable(), + compression: z.string(), + }); +}); + +/** + * + * @typedef {LoggingHttp3} loggingHttp3 + * @property {string} + * @property {number} + * @property {string} + * @property {string} + * @property {string} + * @property {HttpFormat3} + * @property {HttpHeaders4[]} + * @property {HttpCompression3} + */ +export type LoggingHttp3 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingHttp3Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + port: z.number().gte(1).lte(65535), + user: z.string().optional().nullable(), + password: z.string().optional().nullable(), + path: z.string().optional().nullable(), + format: z.string(), + headers: z.array(httpHeaders4Response).max(1000).optional().nullable(), + compression: z.string(), + }) + .transform((data) => ({ + host: data['host'], + port: data['port'], + user: data['user'], + password: data['password'], + path: data['path'], + format: data['format'], + headers: data['headers'], + compression: data['compression'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingHttp3Request = z.lazy(() => { + return z + .object({ + host: z.string().nullish(), + port: z.number().nullish(), + user: z.string().nullish(), + password: z.string().nullish(), + path: z.string().nullish(), + format: z.string().nullish(), + headers: z.array(httpHeaders4Request).nullish(), + compression: z.string().nullish(), + }) + .transform((data) => ({ + host: data['host'], + port: data['port'], + user: data['user'], + password: data['password'], + path: data['path'], + format: data['format'], + headers: data['headers'], + compression: data['compression'], + })); +}); diff --git a/src/services/container-groups/models/logging-new-relic-2.ts b/src/services/container-groups/models/logging-new-relic-2.ts new file mode 100644 index 0000000..50ce7e9 --- /dev/null +++ b/src/services/container-groups/models/logging-new-relic-2.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingNewRelic2 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + ingestionKey: z.string().min(1).max(1000), + }); +}); + +/** + * + * @typedef {LoggingNewRelic2} loggingNewRelic2 + * @property {string} + * @property {string} + */ +export type LoggingNewRelic2 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingNewRelic2Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + ingestion_key: z.string().min(1).max(1000), + }) + .transform((data) => ({ + host: data['host'], + ingestionKey: data['ingestion_key'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingNewRelic2Request = z.lazy(() => { + return z.object({ host: z.string().nullish(), ingestionKey: z.string().nullish() }).transform((data) => ({ + host: data['host'], + ingestion_key: data['ingestionKey'], + })); +}); diff --git a/src/services/container-groups/models/logging-new-relic-3.ts b/src/services/container-groups/models/logging-new-relic-3.ts new file mode 100644 index 0000000..4382296 --- /dev/null +++ b/src/services/container-groups/models/logging-new-relic-3.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingNewRelic3 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + ingestionKey: z.string().min(1).max(1000), + }); +}); + +/** + * + * @typedef {LoggingNewRelic3} loggingNewRelic3 + * @property {string} + * @property {string} + */ +export type LoggingNewRelic3 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingNewRelic3Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + ingestion_key: z.string().min(1).max(1000), + }) + .transform((data) => ({ + host: data['host'], + ingestionKey: data['ingestion_key'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingNewRelic3Request = z.lazy(() => { + return z.object({ host: z.string().nullish(), ingestionKey: z.string().nullish() }).transform((data) => ({ + host: data['host'], + ingestion_key: data['ingestionKey'], + })); +}); diff --git a/src/services/container-groups/models/logging-splunk-2.ts b/src/services/container-groups/models/logging-splunk-2.ts new file mode 100644 index 0000000..ffe5f77 --- /dev/null +++ b/src/services/container-groups/models/logging-splunk-2.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingSplunk2 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + token: z.string().min(1).max(1000), + }); +}); + +/** + * + * @typedef {LoggingSplunk2} loggingSplunk2 + * @property {string} + * @property {string} + */ +export type LoggingSplunk2 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingSplunk2Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + token: z.string().min(1).max(1000), + }) + .transform((data) => ({ + host: data['host'], + token: data['token'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingSplunk2Request = z.lazy(() => { + return z.object({ host: z.string().nullish(), token: z.string().nullish() }).transform((data) => ({ + host: data['host'], + token: data['token'], + })); +}); diff --git a/src/services/container-groups/models/logging-splunk-3.ts b/src/services/container-groups/models/logging-splunk-3.ts new file mode 100644 index 0000000..2f98d73 --- /dev/null +++ b/src/services/container-groups/models/logging-splunk-3.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingSplunk3 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + token: z.string().min(1).max(1000), + }); +}); + +/** + * + * @typedef {LoggingSplunk3} loggingSplunk3 + * @property {string} + * @property {string} + */ +export type LoggingSplunk3 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingSplunk3Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + token: z.string().min(1).max(1000), + }) + .transform((data) => ({ + host: data['host'], + token: data['token'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingSplunk3Request = z.lazy(() => { + return z.object({ host: z.string().nullish(), token: z.string().nullish() }).transform((data) => ({ + host: data['host'], + token: data['token'], + })); +}); diff --git a/src/services/container-groups/models/logging-tcp-2.ts b/src/services/container-groups/models/logging-tcp-2.ts new file mode 100644 index 0000000..cfd0b30 --- /dev/null +++ b/src/services/container-groups/models/logging-tcp-2.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingTcp2 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + port: z.number().gte(1).lte(65535), + }); +}); + +/** + * + * @typedef {LoggingTcp2} loggingTcp2 + * @property {string} + * @property {number} + */ +export type LoggingTcp2 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingTcp2Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + port: z.number().gte(1).lte(65535), + }) + .transform((data) => ({ + host: data['host'], + port: data['port'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingTcp2Request = z.lazy(() => { + return z.object({ host: z.string().nullish(), port: z.number().nullish() }).transform((data) => ({ + host: data['host'], + port: data['port'], + })); +}); diff --git a/src/services/container-groups/models/logging-tcp-3.ts b/src/services/container-groups/models/logging-tcp-3.ts new file mode 100644 index 0000000..e70179c --- /dev/null +++ b/src/services/container-groups/models/logging-tcp-3.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const loggingTcp3 = z.lazy(() => { + return z.object({ + host: z.string().min(1).max(1000), + port: z.number().gte(1).lte(65535), + }); +}); + +/** + * + * @typedef {LoggingTcp3} loggingTcp3 + * @property {string} + * @property {number} + */ +export type LoggingTcp3 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const loggingTcp3Response = z.lazy(() => { + return z + .object({ + host: z.string().min(1).max(1000), + port: z.number().gte(1).lte(65535), + }) + .transform((data) => ({ + host: data['host'], + port: data['port'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const loggingTcp3Request = z.lazy(() => { + return z.object({ host: z.string().nullish(), port: z.number().nullish() }).transform((data) => ({ + host: data['host'], + port: data['port'], + })); +}); diff --git a/src/services/container-groups/models/registry-authentication-aws-ecr-1.ts b/src/services/container-groups/models/registry-authentication-aws-ecr-1.ts new file mode 100644 index 0000000..772f8a8 --- /dev/null +++ b/src/services/container-groups/models/registry-authentication-aws-ecr-1.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const registryAuthenticationAwsEcr1 = z.lazy(() => { + return z.object({ + accessKeyId: z.string(), + secretAccessKey: z.string(), + }); +}); + +/** + * + * @typedef {RegistryAuthenticationAwsEcr1} registryAuthenticationAwsEcr1 + * @property {string} + * @property {string} + */ +export type RegistryAuthenticationAwsEcr1 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationAwsEcr1Response = z.lazy(() => { + return z + .object({ + access_key_id: z.string(), + secret_access_key: z.string(), + }) + .transform((data) => ({ + accessKeyId: data['access_key_id'], + secretAccessKey: data['secret_access_key'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationAwsEcr1Request = z.lazy(() => { + return z.object({ accessKeyId: z.string().nullish(), secretAccessKey: z.string().nullish() }).transform((data) => ({ + access_key_id: data['accessKeyId'], + secret_access_key: data['secretAccessKey'], + })); +}); diff --git a/src/services/container-groups/models/registry-authentication-aws-ecr-2.ts b/src/services/container-groups/models/registry-authentication-aws-ecr-2.ts new file mode 100644 index 0000000..eff5c81 --- /dev/null +++ b/src/services/container-groups/models/registry-authentication-aws-ecr-2.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const registryAuthenticationAwsEcr2 = z.lazy(() => { + return z.object({ + accessKeyId: z.string(), + secretAccessKey: z.string(), + }); +}); + +/** + * + * @typedef {RegistryAuthenticationAwsEcr2} registryAuthenticationAwsEcr2 + * @property {string} + * @property {string} + */ +export type RegistryAuthenticationAwsEcr2 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationAwsEcr2Response = z.lazy(() => { + return z + .object({ + access_key_id: z.string(), + secret_access_key: z.string(), + }) + .transform((data) => ({ + accessKeyId: data['access_key_id'], + secretAccessKey: data['secret_access_key'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationAwsEcr2Request = z.lazy(() => { + return z.object({ accessKeyId: z.string().nullish(), secretAccessKey: z.string().nullish() }).transform((data) => ({ + access_key_id: data['accessKeyId'], + secret_access_key: data['secretAccessKey'], + })); +}); diff --git a/src/services/container-groups/models/registry-authentication-basic-1.ts b/src/services/container-groups/models/registry-authentication-basic-1.ts new file mode 100644 index 0000000..5b055ce --- /dev/null +++ b/src/services/container-groups/models/registry-authentication-basic-1.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const registryAuthenticationBasic1 = z.lazy(() => { + return z.object({ + username: z.string(), + password: z.string(), + }); +}); + +/** + * + * @typedef {RegistryAuthenticationBasic1} registryAuthenticationBasic1 + * @property {string} + * @property {string} + */ +export type RegistryAuthenticationBasic1 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationBasic1Response = z.lazy(() => { + return z + .object({ + username: z.string(), + password: z.string(), + }) + .transform((data) => ({ + username: data['username'], + password: data['password'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationBasic1Request = z.lazy(() => { + return z.object({ username: z.string().nullish(), password: z.string().nullish() }).transform((data) => ({ + username: data['username'], + password: data['password'], + })); +}); diff --git a/src/services/container-groups/models/registry-authentication-basic-2.ts b/src/services/container-groups/models/registry-authentication-basic-2.ts new file mode 100644 index 0000000..a0159ae --- /dev/null +++ b/src/services/container-groups/models/registry-authentication-basic-2.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const registryAuthenticationBasic2 = z.lazy(() => { + return z.object({ + username: z.string(), + password: z.string(), + }); +}); + +/** + * + * @typedef {RegistryAuthenticationBasic2} registryAuthenticationBasic2 + * @property {string} + * @property {string} + */ +export type RegistryAuthenticationBasic2 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationBasic2Response = z.lazy(() => { + return z + .object({ + username: z.string(), + password: z.string(), + }) + .transform((data) => ({ + username: data['username'], + password: data['password'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationBasic2Request = z.lazy(() => { + return z.object({ username: z.string().nullish(), password: z.string().nullish() }).transform((data) => ({ + username: data['username'], + password: data['password'], + })); +}); diff --git a/src/services/container-groups/models/registry-authentication-docker-hub-1.ts b/src/services/container-groups/models/registry-authentication-docker-hub-1.ts new file mode 100644 index 0000000..e46b704 --- /dev/null +++ b/src/services/container-groups/models/registry-authentication-docker-hub-1.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const registryAuthenticationDockerHub1 = z.lazy(() => { + return z.object({ + username: z.string(), + personalAccessToken: z.string(), + }); +}); + +/** + * + * @typedef {RegistryAuthenticationDockerHub1} registryAuthenticationDockerHub1 + * @property {string} + * @property {string} + */ +export type RegistryAuthenticationDockerHub1 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationDockerHub1Response = z.lazy(() => { + return z + .object({ + username: z.string(), + personal_access_token: z.string(), + }) + .transform((data) => ({ + username: data['username'], + personalAccessToken: data['personal_access_token'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationDockerHub1Request = z.lazy(() => { + return z.object({ username: z.string().nullish(), personalAccessToken: z.string().nullish() }).transform((data) => ({ + username: data['username'], + personal_access_token: data['personalAccessToken'], + })); +}); diff --git a/src/services/container-groups/models/registry-authentication-docker-hub-2.ts b/src/services/container-groups/models/registry-authentication-docker-hub-2.ts new file mode 100644 index 0000000..9095d91 --- /dev/null +++ b/src/services/container-groups/models/registry-authentication-docker-hub-2.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const registryAuthenticationDockerHub2 = z.lazy(() => { + return z.object({ + username: z.string(), + personalAccessToken: z.string(), + }); +}); + +/** + * + * @typedef {RegistryAuthenticationDockerHub2} registryAuthenticationDockerHub2 + * @property {string} + * @property {string} + */ +export type RegistryAuthenticationDockerHub2 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationDockerHub2Response = z.lazy(() => { + return z + .object({ + username: z.string(), + personal_access_token: z.string(), + }) + .transform((data) => ({ + username: data['username'], + personalAccessToken: data['personal_access_token'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationDockerHub2Request = z.lazy(() => { + return z.object({ username: z.string().nullish(), personalAccessToken: z.string().nullish() }).transform((data) => ({ + username: data['username'], + personal_access_token: data['personalAccessToken'], + })); +}); diff --git a/src/services/container-groups/models/registry-authentication-gcp-gar-1.ts b/src/services/container-groups/models/registry-authentication-gcp-gar-1.ts new file mode 100644 index 0000000..01b51b2 --- /dev/null +++ b/src/services/container-groups/models/registry-authentication-gcp-gar-1.ts @@ -0,0 +1,41 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const registryAuthenticationGcpGar1 = z.lazy(() => { + return z.object({ + serviceKey: z.string(), + }); +}); + +/** + * + * @typedef {RegistryAuthenticationGcpGar1} registryAuthenticationGcpGar1 + * @property {string} + */ +export type RegistryAuthenticationGcpGar1 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationGcpGar1Response = z.lazy(() => { + return z + .object({ + service_key: z.string(), + }) + .transform((data) => ({ + serviceKey: data['service_key'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationGcpGar1Request = z.lazy(() => { + return z.object({ serviceKey: z.string().nullish() }).transform((data) => ({ + service_key: data['serviceKey'], + })); +}); diff --git a/src/services/container-groups/models/registry-authentication-gcp-gar-2.ts b/src/services/container-groups/models/registry-authentication-gcp-gar-2.ts new file mode 100644 index 0000000..df16406 --- /dev/null +++ b/src/services/container-groups/models/registry-authentication-gcp-gar-2.ts @@ -0,0 +1,41 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const registryAuthenticationGcpGar2 = z.lazy(() => { + return z.object({ + serviceKey: z.string(), + }); +}); + +/** + * + * @typedef {RegistryAuthenticationGcpGar2} registryAuthenticationGcpGar2 + * @property {string} + */ +export type RegistryAuthenticationGcpGar2 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationGcpGar2Response = z.lazy(() => { + return z + .object({ + service_key: z.string(), + }) + .transform((data) => ({ + serviceKey: data['service_key'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationGcpGar2Request = z.lazy(() => { + return z.object({ serviceKey: z.string().nullish() }).transform((data) => ({ + service_key: data['serviceKey'], + })); +}); diff --git a/src/services/container-groups/models/registry-authentication-gcp-gcr-1.ts b/src/services/container-groups/models/registry-authentication-gcp-gcr-1.ts new file mode 100644 index 0000000..01d6fa4 --- /dev/null +++ b/src/services/container-groups/models/registry-authentication-gcp-gcr-1.ts @@ -0,0 +1,41 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const registryAuthenticationGcpGcr1 = z.lazy(() => { + return z.object({ + serviceKey: z.string(), + }); +}); + +/** + * + * @typedef {RegistryAuthenticationGcpGcr1} registryAuthenticationGcpGcr1 + * @property {string} + */ +export type RegistryAuthenticationGcpGcr1 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationGcpGcr1Response = z.lazy(() => { + return z + .object({ + service_key: z.string(), + }) + .transform((data) => ({ + serviceKey: data['service_key'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationGcpGcr1Request = z.lazy(() => { + return z.object({ serviceKey: z.string().nullish() }).transform((data) => ({ + service_key: data['serviceKey'], + })); +}); diff --git a/src/services/container-groups/models/registry-authentication-gcp-gcr-2.ts b/src/services/container-groups/models/registry-authentication-gcp-gcr-2.ts new file mode 100644 index 0000000..106c25d --- /dev/null +++ b/src/services/container-groups/models/registry-authentication-gcp-gcr-2.ts @@ -0,0 +1,41 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const registryAuthenticationGcpGcr2 = z.lazy(() => { + return z.object({ + serviceKey: z.string(), + }); +}); + +/** + * + * @typedef {RegistryAuthenticationGcpGcr2} registryAuthenticationGcpGcr2 + * @property {string} + */ +export type RegistryAuthenticationGcpGcr2 = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationGcpGcr2Response = z.lazy(() => { + return z + .object({ + service_key: z.string(), + }) + .transform((data) => ({ + serviceKey: data['service_key'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const registryAuthenticationGcpGcr2Request = z.lazy(() => { + return z.object({ serviceKey: z.string().nullish() }).transform((data) => ({ + service_key: data['serviceKey'], + })); +}); diff --git a/src/services/container-groups/models/resources.ts b/src/services/container-groups/models/resources.ts new file mode 100644 index 0000000..5b31a64 --- /dev/null +++ b/src/services/container-groups/models/resources.ts @@ -0,0 +1,63 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const resources = z.lazy(() => { + return z.object({ + cpu: z.number().gte(1).lte(16).optional().nullable(), + memory: z.number().gte(1024).lte(30720).optional().nullable(), + gpuClasses: z.array(z.string()).optional().nullable(), + storageAmount: z.number().gte(1073741824).lte(53687091200).optional().nullable(), + }); +}); + +/** + * + * @typedef {Resources} resources + * @property {number} + * @property {number} + * @property {string[]} + * @property {number} + */ +export type Resources = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const resourcesResponse = z.lazy(() => { + return z + .object({ + cpu: z.number().gte(1).lte(16).optional().nullable(), + memory: z.number().gte(1024).lte(30720).optional().nullable(), + gpu_classes: z.array(z.string()).optional().nullable(), + storage_amount: z.number().gte(1073741824).lte(53687091200).optional().nullable(), + }) + .transform((data) => ({ + cpu: data['cpu'], + memory: data['memory'], + gpuClasses: data['gpu_classes'], + storageAmount: data['storage_amount'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const resourcesRequest = z.lazy(() => { + return z + .object({ + cpu: z.number().nullish(), + memory: z.number().nullish(), + gpuClasses: z.array(z.string()).nullish(), + storageAmount: z.number().nullish(), + }) + .transform((data) => ({ + cpu: data['cpu'], + memory: data['memory'], + gpu_classes: data['gpuClasses'], + storage_amount: data['storageAmount'], + })); +}); diff --git a/src/services/container-groups/models/state.ts b/src/services/container-groups/models/state.ts new file mode 100644 index 0000000..49ab4c0 --- /dev/null +++ b/src/services/container-groups/models/state.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +export enum State { + ALLOCATING = 'allocating', + DOWNLOADING = 'downloading', + CREATING = 'creating', + RUNNING = 'running', + STOPPING = 'stopping', +} diff --git a/src/services/container-groups/models/update-container-group-networking.ts b/src/services/container-groups/models/update-container-group-networking.ts new file mode 100644 index 0000000..e8f8bcb --- /dev/null +++ b/src/services/container-groups/models/update-container-group-networking.ts @@ -0,0 +1,41 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const updateContainerGroupNetworking = z.lazy(() => { + return z.object({ + port: z.number().gte(1).lte(65535).optional().nullable(), + }); +}); + +/** + * Represents update container group networking parameters + * @typedef {UpdateContainerGroupNetworking} updateContainerGroupNetworking - Represents update container group networking parameters - Represents update container group networking parameters + * @property {number} + */ +export type UpdateContainerGroupNetworking = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const updateContainerGroupNetworkingResponse = z.lazy(() => { + return z + .object({ + port: z.number().gte(1).lte(65535).optional().nullable(), + }) + .transform((data) => ({ + port: data['port'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const updateContainerGroupNetworkingRequest = z.lazy(() => { + return z.object({ port: z.number().nullish() }).transform((data) => ({ + port: data['port'], + })); +}); diff --git a/src/services/container-groups/models/update-container-group.ts b/src/services/container-groups/models/update-container-group.ts new file mode 100644 index 0000000..cde73dc --- /dev/null +++ b/src/services/container-groups/models/update-container-group.ts @@ -0,0 +1,120 @@ +import { z } from 'zod'; +import { updateContainer, updateContainerRequest, updateContainerResponse } from './update-container'; +import { + updateContainerGroupNetworking, + updateContainerGroupNetworkingRequest, + updateContainerGroupNetworkingResponse, +} from './update-container-group-networking'; +import { + containerGroupLivenessProbe, + containerGroupLivenessProbeRequest, + containerGroupLivenessProbeResponse, +} from '../../common/container-group-liveness-probe'; +import { + containerGroupReadinessProbe, + containerGroupReadinessProbeRequest, + containerGroupReadinessProbeResponse, +} from '../../common/container-group-readiness-probe'; +import { + containerGroupStartupProbe, + containerGroupStartupProbeRequest, + containerGroupStartupProbeResponse, +} from '../../common/container-group-startup-probe'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const updateContainerGroup = z.lazy(() => { + return z.object({ + displayName: z + .string() + .min(2) + .max(63) + .regex(/^[ ,-.0-9A-Za-z]+$/) + .optional() + .nullable(), + container: updateContainer.optional().nullable(), + replicas: z.number().gte(0).lte(250).optional().nullable(), + countryCodes: z.array(z.string()).min(1).max(500).optional().nullable(), + networking: updateContainerGroupNetworking.optional(), + livenessProbe: containerGroupLivenessProbe.optional().nullable(), + readinessProbe: containerGroupReadinessProbe.optional().nullable(), + startupProbe: containerGroupStartupProbe.optional().nullable(), + }); +}); + +/** + * Represents a request to update a container group + * @typedef {UpdateContainerGroup} updateContainerGroup - Represents a request to update a container group - Represents a request to update a container group + * @property {string} + * @property {UpdateContainer} - Represents an update container object + * @property {number} + * @property {CountryCode[]} - List of countries nodes must be located in. Remove this field to permit nodes from any country. + * @property {UpdateContainerGroupNetworking} - Represents update container group networking parameters + * @property {ContainerGroupLivenessProbe} - Represents the container group liveness probe + * @property {ContainerGroupReadinessProbe} - Represents the container group readiness probe + * @property {ContainerGroupStartupProbe} - Represents the container group startup probe + */ +export type UpdateContainerGroup = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const updateContainerGroupResponse = z.lazy(() => { + return z + .object({ + display_name: z + .string() + .min(2) + .max(63) + .regex(/^[ ,-.0-9A-Za-z]+$/) + .optional() + .nullable(), + container: updateContainerResponse.optional().nullable(), + replicas: z.number().gte(0).lte(250).optional().nullable(), + country_codes: z.array(z.string()).min(1).max(500).optional().nullable(), + networking: updateContainerGroupNetworkingResponse.optional(), + liveness_probe: containerGroupLivenessProbeResponse.optional().nullable(), + readiness_probe: containerGroupReadinessProbeResponse.optional().nullable(), + startup_probe: containerGroupStartupProbeResponse.optional().nullable(), + }) + .transform((data) => ({ + displayName: data['display_name'], + container: data['container'], + replicas: data['replicas'], + countryCodes: data['country_codes'], + networking: data['networking'], + livenessProbe: data['liveness_probe'], + readinessProbe: data['readiness_probe'], + startupProbe: data['startup_probe'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const updateContainerGroupRequest = z.lazy(() => { + return z + .object({ + displayName: z.string().nullish(), + container: updateContainerRequest.nullish(), + replicas: z.number().nullish(), + countryCodes: z.array(z.string()).nullish(), + networking: updateContainerGroupNetworkingRequest.nullish(), + livenessProbe: containerGroupLivenessProbeRequest.nullish(), + readinessProbe: containerGroupReadinessProbeRequest.nullish(), + startupProbe: containerGroupStartupProbeRequest.nullish(), + }) + .transform((data) => ({ + display_name: data['displayName'], + container: data['container'], + replicas: data['replicas'], + country_codes: data['countryCodes'], + networking: data['networking'], + liveness_probe: data['livenessProbe'], + readiness_probe: data['readinessProbe'], + startup_probe: data['startupProbe'], + })); +}); diff --git a/src/services/container-groups/models/update-container-logging.ts b/src/services/container-groups/models/update-container-logging.ts new file mode 100644 index 0000000..e51a028 --- /dev/null +++ b/src/services/container-groups/models/update-container-logging.ts @@ -0,0 +1,81 @@ +import { z } from 'zod'; +import { loggingAxiom3, loggingAxiom3Request, loggingAxiom3Response } from './logging-axiom-3'; +import { loggingDatadog3, loggingDatadog3Request, loggingDatadog3Response } from './logging-datadog-3'; +import { loggingNewRelic3, loggingNewRelic3Request, loggingNewRelic3Response } from './logging-new-relic-3'; +import { loggingSplunk3, loggingSplunk3Request, loggingSplunk3Response } from './logging-splunk-3'; +import { loggingTcp3, loggingTcp3Request, loggingTcp3Response } from './logging-tcp-3'; +import { loggingHttp3, loggingHttp3Request, loggingHttp3Response } from './logging-http-3'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const updateContainerLogging = z.lazy(() => { + return z.object({ + axiom: loggingAxiom3.optional().nullable(), + datadog: loggingDatadog3.optional().nullable(), + newRelic: loggingNewRelic3.optional().nullable(), + splunk: loggingSplunk3.optional().nullable(), + tcp: loggingTcp3.optional().nullable(), + http: loggingHttp3.optional().nullable(), + }); +}); + +/** + * + * @typedef {UpdateContainerLogging} updateContainerLogging + * @property {LoggingAxiom3} + * @property {LoggingDatadog3} + * @property {LoggingNewRelic3} + * @property {LoggingSplunk3} + * @property {LoggingTcp3} + * @property {LoggingHttp3} + */ +export type UpdateContainerLogging = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const updateContainerLoggingResponse = z.lazy(() => { + return z + .object({ + axiom: loggingAxiom3Response.optional().nullable(), + datadog: loggingDatadog3Response.optional().nullable(), + new_relic: loggingNewRelic3Response.optional().nullable(), + splunk: loggingSplunk3Response.optional().nullable(), + tcp: loggingTcp3Response.optional().nullable(), + http: loggingHttp3Response.optional().nullable(), + }) + .transform((data) => ({ + axiom: data['axiom'], + datadog: data['datadog'], + newRelic: data['new_relic'], + splunk: data['splunk'], + tcp: data['tcp'], + http: data['http'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const updateContainerLoggingRequest = z.lazy(() => { + return z + .object({ + axiom: loggingAxiom3Request.nullish(), + datadog: loggingDatadog3Request.nullish(), + newRelic: loggingNewRelic3Request.nullish(), + splunk: loggingSplunk3Request.nullish(), + tcp: loggingTcp3Request.nullish(), + http: loggingHttp3Request.nullish(), + }) + .transform((data) => ({ + axiom: data['axiom'], + datadog: data['datadog'], + new_relic: data['newRelic'], + splunk: data['splunk'], + tcp: data['tcp'], + http: data['http'], + })); +}); diff --git a/src/services/container-groups/models/update-container-registry-authentication.ts b/src/services/container-groups/models/update-container-registry-authentication.ts new file mode 100644 index 0000000..0602a29 --- /dev/null +++ b/src/services/container-groups/models/update-container-registry-authentication.ts @@ -0,0 +1,94 @@ +import { z } from 'zod'; +import { + registryAuthenticationBasic2, + registryAuthenticationBasic2Request, + registryAuthenticationBasic2Response, +} from './registry-authentication-basic-2'; +import { + registryAuthenticationGcpGcr2, + registryAuthenticationGcpGcr2Request, + registryAuthenticationGcpGcr2Response, +} from './registry-authentication-gcp-gcr-2'; +import { + registryAuthenticationAwsEcr2, + registryAuthenticationAwsEcr2Request, + registryAuthenticationAwsEcr2Response, +} from './registry-authentication-aws-ecr-2'; +import { + registryAuthenticationDockerHub2, + registryAuthenticationDockerHub2Request, + registryAuthenticationDockerHub2Response, +} from './registry-authentication-docker-hub-2'; +import { + registryAuthenticationGcpGar2, + registryAuthenticationGcpGar2Request, + registryAuthenticationGcpGar2Response, +} from './registry-authentication-gcp-gar-2'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const updateContainerRegistryAuthentication = z.lazy(() => { + return z.object({ + basic: registryAuthenticationBasic2.optional().nullable(), + gcpGcr: registryAuthenticationGcpGcr2.optional().nullable(), + awsEcr: registryAuthenticationAwsEcr2.optional().nullable(), + dockerHub: registryAuthenticationDockerHub2.optional().nullable(), + gcpGar: registryAuthenticationGcpGar2.optional().nullable(), + }); +}); + +/** + * + * @typedef {UpdateContainerRegistryAuthentication} updateContainerRegistryAuthentication + * @property {RegistryAuthenticationBasic2} + * @property {RegistryAuthenticationGcpGcr2} + * @property {RegistryAuthenticationAwsEcr2} + * @property {RegistryAuthenticationDockerHub2} + * @property {RegistryAuthenticationGcpGar2} + */ +export type UpdateContainerRegistryAuthentication = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const updateContainerRegistryAuthenticationResponse = z.lazy(() => { + return z + .object({ + basic: registryAuthenticationBasic2Response.optional().nullable(), + gcp_gcr: registryAuthenticationGcpGcr2Response.optional().nullable(), + aws_ecr: registryAuthenticationAwsEcr2Response.optional().nullable(), + docker_hub: registryAuthenticationDockerHub2Response.optional().nullable(), + gcp_gar: registryAuthenticationGcpGar2Response.optional().nullable(), + }) + .transform((data) => ({ + basic: data['basic'], + gcpGcr: data['gcp_gcr'], + awsEcr: data['aws_ecr'], + dockerHub: data['docker_hub'], + gcpGar: data['gcp_gar'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const updateContainerRegistryAuthenticationRequest = z.lazy(() => { + return z + .object({ + basic: registryAuthenticationBasic2Request.nullish(), + gcpGcr: registryAuthenticationGcpGcr2Request.nullish(), + awsEcr: registryAuthenticationAwsEcr2Request.nullish(), + dockerHub: registryAuthenticationDockerHub2Request.nullish(), + gcpGar: registryAuthenticationGcpGar2Request.nullish(), + }) + .transform((data) => ({ + basic: data['basic'], + gcp_gcr: data['gcpGcr'], + aws_ecr: data['awsEcr'], + docker_hub: data['dockerHub'], + gcp_gar: data['gcpGar'], + })); +}); diff --git a/src/services/container-groups/models/update-container.ts b/src/services/container-groups/models/update-container.ts new file mode 100644 index 0000000..c52c588 --- /dev/null +++ b/src/services/container-groups/models/update-container.ts @@ -0,0 +1,92 @@ +import { z } from 'zod'; +import { resources, resourcesRequest, resourcesResponse } from './resources'; +import { + updateContainerLogging, + updateContainerLoggingRequest, + updateContainerLoggingResponse, +} from './update-container-logging'; +import { + updateContainerRegistryAuthentication, + updateContainerRegistryAuthenticationRequest, + updateContainerRegistryAuthenticationResponse, +} from './update-container-registry-authentication'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const updateContainer = z.lazy(() => { + return z.object({ + image: z.string().min(1).max(1024).optional().nullable(), + resources: resources.optional().nullable(), + command: z.array(z.string()).max(100).optional().nullable(), + priority: z.string().optional().nullable(), + environmentVariables: z.any().optional(), + logging: updateContainerLogging.optional().nullable(), + registryAuthentication: updateContainerRegistryAuthentication.optional().nullable(), + }); +}); + +/** + * Represents an update container object + * @typedef {UpdateContainer} updateContainer - Represents an update container object - Represents an update container object + * @property {string} + * @property {Resources} + * @property {string[]} - Pass a command (and optional arguments) to override the ENTRYPOINT and CMD of a container image. + * @property {ContainerGroupPriority} + * @property {any} + * @property {UpdateContainerLogging} + * @property {UpdateContainerRegistryAuthentication} + */ +export type UpdateContainer = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const updateContainerResponse = z.lazy(() => { + return z + .object({ + image: z.string().min(1).max(1024).optional().nullable(), + resources: resourcesResponse.optional().nullable(), + command: z.array(z.string()).max(100).optional().nullable(), + priority: z.string().optional().nullable(), + environment_variables: z.any().optional(), + logging: updateContainerLoggingResponse.optional().nullable(), + registry_authentication: updateContainerRegistryAuthenticationResponse.optional().nullable(), + }) + .transform((data) => ({ + image: data['image'], + resources: data['resources'], + command: data['command'], + priority: data['priority'], + environmentVariables: data['environment_variables'], + logging: data['logging'], + registryAuthentication: data['registry_authentication'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const updateContainerRequest = z.lazy(() => { + return z + .object({ + image: z.string().nullish(), + resources: resourcesRequest.nullish(), + command: z.array(z.string()).nullish(), + priority: z.string().nullish(), + environmentVariables: z.any().nullish(), + logging: updateContainerLoggingRequest.nullish(), + registryAuthentication: updateContainerRegistryAuthenticationRequest.nullish(), + }) + .transform((data) => ({ + image: data['image'], + resources: data['resources'], + command: data['command'], + priority: data['priority'], + environment_variables: data['environmentVariables'], + logging: data['logging'], + registry_authentication: data['registryAuthentication'], + })); +}); diff --git a/src/services/inference-endpoints/index.ts b/src/services/inference-endpoints/index.ts new file mode 100644 index 0000000..c94be7e --- /dev/null +++ b/src/services/inference-endpoints/index.ts @@ -0,0 +1,2 @@ +export { InferenceEndpointsService } from './inference-endpoints'; +export * from './models'; diff --git a/src/services/inference-endpoints/inference-endpoints.ts b/src/services/inference-endpoints/inference-endpoints.ts new file mode 100644 index 0000000..1516745 --- /dev/null +++ b/src/services/inference-endpoints/inference-endpoints.ts @@ -0,0 +1,258 @@ +import { z } from 'zod'; +import { BaseService } from '../base-service'; +import { ContentType, HttpResponse, RequestConfig } from '../../http/types'; +import { RequestBuilder } from '../../http/transport/request-builder'; +import { SerializationStyle } from '../../http/serialization/base-serializer'; +import { InferenceEndpointsList, inferenceEndpointsListResponse } from './models/inference-endpoints-list'; +import { GetInferenceEndpointJobsParams, ListInferenceEndpointsParams } from './request-params'; +import { InferenceEndpoint, inferenceEndpointResponse } from './models/inference-endpoint'; +import { InferenceEndpointJobList, inferenceEndpointJobListResponse } from './models/inference-endpoint-job-list'; +import { CreateInferenceEndpointJob, createInferenceEndpointJobRequest } from './models/create-inference-endpoint-job'; +import { InferenceEndpointJob, inferenceEndpointJobResponse } from './models/inference-endpoint-job'; + +export class InferenceEndpointsService extends BaseService { + /** + * Gets the list of all inference endpoints + * @param {string} organizationName - The unique organization name + * @param {number} [page] - The page number + * @param {number} [pageSize] - The number of items per page + * @returns {Promise>} OK + */ + async listInferenceEndpoints( + organizationName: string, + params?: ListInferenceEndpointsParams, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath('/organizations/{organization_name}/inference-endpoints') + .setRequestSchema(z.any()) + .setResponseSchema(inferenceEndpointsListResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addQueryParam({ + key: 'page', + value: params?.page, + }) + .addQueryParam({ + key: 'page_size', + value: params?.pageSize, + }) + .build(); + return this.client.call(request); + } + + /** + * Gets an inference endpoint + * @param {string} organizationName - The unique organization name + * @param {string} inferenceEndpointName - The unique inference endpoint name + * @returns {Promise>} OK + */ + async getInferenceEndpoint( + organizationName: string, + inferenceEndpointName: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath('/organizations/{organization_name}/inference-endpoints/{inference_endpoint_name}') + .setRequestSchema(z.any()) + .setResponseSchema(inferenceEndpointResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'inference_endpoint_name', + value: inferenceEndpointName, + }) + .build(); + return this.client.call(request); + } + + /** + * Retrieves a list of an inference endpoint jobs + * @param {string} organizationName - The unique organization name + * @param {string} inferenceEndpointName - The unique inference endpoint name + * @param {number} [page] - The page number + * @param {number} [pageSize] - The number of items per page + * @returns {Promise>} OK + */ + async getInferenceEndpointJobs( + organizationName: string, + inferenceEndpointName: string, + params?: GetInferenceEndpointJobsParams, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath('/organizations/{organization_name}/inference-endpoints/{inference_endpoint_name}/jobs') + .setRequestSchema(z.any()) + .setResponseSchema(inferenceEndpointJobListResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'inference_endpoint_name', + value: inferenceEndpointName, + }) + .addQueryParam({ + key: 'page', + value: params?.page, + }) + .addQueryParam({ + key: 'page_size', + value: params?.pageSize, + }) + .build(); + return this.client.call(request); + } + + /** + * Creates a new job + * @param {string} organizationName - The unique organization name + * @param {string} inferenceEndpointName - The unique inference endpoint name + * @returns {Promise>} Created + */ + async createInferenceEndpointJob( + organizationName: string, + inferenceEndpointName: string, + body: CreateInferenceEndpointJob, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('POST') + .setPath('/organizations/{organization_name}/inference-endpoints/{inference_endpoint_name}/jobs') + .setRequestSchema(createInferenceEndpointJobRequest) + .setResponseSchema(inferenceEndpointJobResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'inference_endpoint_name', + value: inferenceEndpointName, + }) + .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) + .addBody(body) + .build(); + return this.client.call(request); + } + + /** + * Retrieves a job in an inference endpoint + * @param {string} organizationName - The unique organization name + * @param {string} inferenceEndpointName - The unique inference endpoint name + * @param {string} inferenceEndpointJobId - The unique job id + * @returns {Promise>} Ok + */ + async getInferenceEndpointJob( + organizationName: string, + inferenceEndpointName: string, + inferenceEndpointJobId: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath( + '/organizations/{organization_name}/inference-endpoints/{inference_endpoint_name}/jobs/{inference_endpoint_job_id}', + ) + .setRequestSchema(z.any()) + .setResponseSchema(inferenceEndpointJobResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'inference_endpoint_name', + value: inferenceEndpointName, + }) + .addPathParam({ + key: 'inference_endpoint_job_id', + value: inferenceEndpointJobId, + }) + .build(); + return this.client.call(request); + } + + /** + * Deletes an inference endpoint job + * @param {string} organizationName - The unique organization name + * @param {string} inferenceEndpointName - The unique inference endpoint name + * @param {string} inferenceEndpointJobId - The unique job id + * @returns {Promise>} Accepted + */ + async deleteInferenceEndpointJob( + organizationName: string, + inferenceEndpointName: string, + inferenceEndpointJobId: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('DELETE') + .setPath( + '/organizations/{organization_name}/inference-endpoints/{inference_endpoint_name}/jobs/{inference_endpoint_job_id}', + ) + .setRequestSchema(z.any()) + .setResponseSchema(z.undefined()) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'inference_endpoint_name', + value: inferenceEndpointName, + }) + .addPathParam({ + key: 'inference_endpoint_job_id', + value: inferenceEndpointJobId, + }) + .build(); + return this.client.call(request); + } +} diff --git a/src/services/inference-endpoints/models/create-inference-endpoint-job.ts b/src/services/inference-endpoints/models/create-inference-endpoint-job.ts new file mode 100644 index 0000000..e89be0f --- /dev/null +++ b/src/services/inference-endpoints/models/create-inference-endpoint-job.ts @@ -0,0 +1,53 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const createInferenceEndpointJob = z.lazy(() => { + return z.object({ + input: z.any(), + metadata: z.any().optional().nullable(), + webhook: z.string().optional().nullable(), + }); +}); + +/** + * Represents a request to create a inference endpoint job + * @typedef {CreateInferenceEndpointJob} createInferenceEndpointJob - Represents a request to create a inference endpoint job - Represents a request to create a inference endpoint job + * @property {any} - The job input. May be any valid JSON. + * @property {any} + * @property {string} + */ +export type CreateInferenceEndpointJob = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const createInferenceEndpointJobResponse = z.lazy(() => { + return z + .object({ + input: z.any(), + metadata: z.any().optional().nullable(), + webhook: z.string().optional().nullable(), + }) + .transform((data) => ({ + input: data['input'], + metadata: data['metadata'], + webhook: data['webhook'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const createInferenceEndpointJobRequest = z.lazy(() => { + return z + .object({ input: z.any().nullish(), metadata: z.any().nullish(), webhook: z.string().nullish() }) + .transform((data) => ({ + input: data['input'], + metadata: data['metadata'], + webhook: data['webhook'], + })); +}); diff --git a/src/services/inference-endpoints/models/index.ts b/src/services/inference-endpoints/models/index.ts new file mode 100644 index 0000000..cc84b16 --- /dev/null +++ b/src/services/inference-endpoints/models/index.ts @@ -0,0 +1,8 @@ +export type { InferenceEndpointsList } from './inference-endpoints-list'; +export type { InferenceEndpoint } from './inference-endpoint'; +export type { InferenceEndpointJobList } from './inference-endpoint-job-list'; +export type { CreateInferenceEndpointJob } from './create-inference-endpoint-job'; +export type { InferenceEndpointJob } from './inference-endpoint-job'; +export { InferenceEndpointJobStatus } from './inference-endpoint-job-status'; +export type { InferenceEndpointJobEvent } from './inference-endpoint-job-event'; +export { InferenceEndpointJobEventAction } from './inference-endpoint-job-event-action'; diff --git a/src/services/inference-endpoints/models/inference-endpoint-job-event-action.ts b/src/services/inference-endpoints/models/inference-endpoint-job-event-action.ts new file mode 100644 index 0000000..f85f691 --- /dev/null +++ b/src/services/inference-endpoints/models/inference-endpoint-job-event-action.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +export enum InferenceEndpointJobEventAction { + CREATED = 'created', + STARTED = 'started', + SUCCEEDED = 'succeeded', + CANCELLED = 'cancelled', + FAILED = 'failed', +} diff --git a/src/services/inference-endpoints/models/inference-endpoint-job-event.ts b/src/services/inference-endpoints/models/inference-endpoint-job-event.ts new file mode 100644 index 0000000..a0e3a6f --- /dev/null +++ b/src/services/inference-endpoints/models/inference-endpoint-job-event.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const inferenceEndpointJobEvent = z.lazy(() => { + return z.object({ + action: z.string(), + time: z.string(), + }); +}); + +/** + * Represents an event for inference endpoint job + * @typedef {InferenceEndpointJobEvent} inferenceEndpointJobEvent - Represents an event for inference endpoint job - Represents an event for inference endpoint job + * @property {InferenceEndpointJobEventAction} + * @property {string} + */ +export type InferenceEndpointJobEvent = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const inferenceEndpointJobEventResponse = z.lazy(() => { + return z + .object({ + action: z.string(), + time: z.string(), + }) + .transform((data) => ({ + action: data['action'], + time: data['time'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const inferenceEndpointJobEventRequest = z.lazy(() => { + return z.object({ action: z.string().nullish(), time: z.string().nullish() }).transform((data) => ({ + action: data['action'], + time: data['time'], + })); +}); diff --git a/src/services/inference-endpoints/models/inference-endpoint-job-list.ts b/src/services/inference-endpoints/models/inference-endpoint-job-list.ts new file mode 100644 index 0000000..03fd0de --- /dev/null +++ b/src/services/inference-endpoints/models/inference-endpoint-job-list.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; +import { + inferenceEndpointJob, + inferenceEndpointJobRequest, + inferenceEndpointJobResponse, +} from './inference-endpoint-job'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const inferenceEndpointJobList = z.lazy(() => { + return z.object({ + items: z.array(inferenceEndpointJob).max(100), + }); +}); + +/** + * Represents a list of inference endpoint jobs + * @typedef {InferenceEndpointJobList} inferenceEndpointJobList - Represents a list of inference endpoint jobs - Represents a list of inference endpoint jobs + * @property {InferenceEndpointJob[]} - The list of items + */ +export type InferenceEndpointJobList = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const inferenceEndpointJobListResponse = z.lazy(() => { + return z + .object({ + items: z.array(inferenceEndpointJobResponse).max(100), + }) + .transform((data) => ({ + items: data['items'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const inferenceEndpointJobListRequest = z.lazy(() => { + return z.object({ items: z.array(inferenceEndpointJobRequest).nullish() }).transform((data) => ({ + items: data['items'], + })); +}); diff --git a/src/services/inference-endpoints/models/inference-endpoint-job-status.ts b/src/services/inference-endpoints/models/inference-endpoint-job-status.ts new file mode 100644 index 0000000..35216bf --- /dev/null +++ b/src/services/inference-endpoints/models/inference-endpoint-job-status.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +export enum InferenceEndpointJobStatus { + PENDING = 'pending', + RUNNING = 'running', + SUCCEEDED = 'succeeded', + CANCELLED = 'cancelled', + FAILED = 'failed', +} diff --git a/src/services/inference-endpoints/models/inference-endpoint-job.ts b/src/services/inference-endpoints/models/inference-endpoint-job.ts new file mode 100644 index 0000000..d8ffd31 --- /dev/null +++ b/src/services/inference-endpoints/models/inference-endpoint-job.ts @@ -0,0 +1,110 @@ +import { z } from 'zod'; +import { + inferenceEndpointJobEvent, + inferenceEndpointJobEventRequest, + inferenceEndpointJobEventResponse, +} from './inference-endpoint-job-event'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const inferenceEndpointJob = z.lazy(() => { + return z.object({ + id: z.string(), + input: z.any(), + inferenceEndpointName: z.string(), + metadata: z.any().optional().nullable(), + webhook: z.string().optional().nullable(), + status: z.string(), + events: z.array(inferenceEndpointJobEvent).max(1000), + organizationName: z.string(), + output: z.any().optional(), + createTime: z.string(), + updateTime: z.string(), + }); +}); + +/** + * Represents a inference endpoint job + * @typedef {InferenceEndpointJob} inferenceEndpointJob - Represents a inference endpoint job - Represents a inference endpoint job + * @property {string} + * @property {any} - The job input. May be any valid JSON. + * @property {string} - The inference endpoint name + * @property {any} + * @property {string} + * @property {InferenceEndpointJobStatus} + * @property {InferenceEndpointJobEvent[]} + * @property {string} - The organization name + * @property {any} - The job output. May be any valid JSON. + * @property {string} + * @property {string} + */ +export type InferenceEndpointJob = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const inferenceEndpointJobResponse = z.lazy(() => { + return z + .object({ + id: z.string(), + input: z.any(), + inference_endpoint_name: z.string(), + metadata: z.any().optional().nullable(), + webhook: z.string().optional().nullable(), + status: z.string(), + events: z.array(inferenceEndpointJobEventResponse).max(1000), + organization_name: z.string(), + output: z.any().optional(), + create_time: z.string(), + update_time: z.string(), + }) + .transform((data) => ({ + id: data['id'], + input: data['input'], + inferenceEndpointName: data['inference_endpoint_name'], + metadata: data['metadata'], + webhook: data['webhook'], + status: data['status'], + events: data['events'], + organizationName: data['organization_name'], + output: data['output'], + createTime: data['create_time'], + updateTime: data['update_time'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const inferenceEndpointJobRequest = z.lazy(() => { + return z + .object({ + id: z.string().nullish(), + input: z.any().nullish(), + inferenceEndpointName: z.string().nullish(), + metadata: z.any().nullish(), + webhook: z.string().nullish(), + status: z.string().nullish(), + events: z.array(inferenceEndpointJobEventRequest).nullish(), + organizationName: z.string().nullish(), + output: z.any().nullish(), + createTime: z.string().nullish(), + updateTime: z.string().nullish(), + }) + .transform((data) => ({ + id: data['id'], + input: data['input'], + inference_endpoint_name: data['inferenceEndpointName'], + metadata: data['metadata'], + webhook: data['webhook'], + status: data['status'], + events: data['events'], + organization_name: data['organizationName'], + output: data['output'], + create_time: data['createTime'], + update_time: data['updateTime'], + })); +}); diff --git a/src/services/inference-endpoints/models/inference-endpoint.ts b/src/services/inference-endpoints/models/inference-endpoint.ts new file mode 100644 index 0000000..a4b1042 --- /dev/null +++ b/src/services/inference-endpoints/models/inference-endpoint.ts @@ -0,0 +1,95 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const inferenceEndpoint = z.lazy(() => { + return z.object({ + id: z.string(), + name: z.string(), + displayName: z + .string() + .min(2) + .max(63) + .regex(/^[ ,-.0-9A-Za-z]+$/), + description: z.string(), + endpointUrl: z.string(), + readme: z.string(), + priceDescription: z.string(), + iconImage: z.string(), + }); +}); + +/** + * Represents an inference endpoint + * @typedef {InferenceEndpoint} inferenceEndpoint - Represents an inference endpoint - Represents an inference endpoint + * @property {string} - The unique identifier + * @property {string} - The inference endpoint name + * @property {string} - The inference endpoint display name + * @property {string} - a brief description of the inference endpoint + * @property {string} - The URL of the inference endpoint + * @property {string} - A markdown file containing a detailed description of the inference endpoint + * @property {string} - A description of the price + * @property {string} - The URL of the icon image + */ +export type InferenceEndpoint = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const inferenceEndpointResponse = z.lazy(() => { + return z + .object({ + id: z.string(), + name: z.string(), + display_name: z + .string() + .min(2) + .max(63) + .regex(/^[ ,-.0-9A-Za-z]+$/), + description: z.string(), + endpoint_url: z.string(), + readme: z.string(), + price_description: z.string(), + icon_image: z.string(), + }) + .transform((data) => ({ + id: data['id'], + name: data['name'], + displayName: data['display_name'], + description: data['description'], + endpointUrl: data['endpoint_url'], + readme: data['readme'], + priceDescription: data['price_description'], + iconImage: data['icon_image'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const inferenceEndpointRequest = z.lazy(() => { + return z + .object({ + id: z.string().nullish(), + name: z.string().nullish(), + displayName: z.string().nullish(), + description: z.string().nullish(), + endpointUrl: z.string().nullish(), + readme: z.string().nullish(), + priceDescription: z.string().nullish(), + iconImage: z.string().nullish(), + }) + .transform((data) => ({ + id: data['id'], + name: data['name'], + display_name: data['displayName'], + description: data['description'], + endpoint_url: data['endpointUrl'], + readme: data['readme'], + price_description: data['priceDescription'], + icon_image: data['iconImage'], + })); +}); diff --git a/src/services/inference-endpoints/models/inference-endpoints-list.ts b/src/services/inference-endpoints/models/inference-endpoints-list.ts new file mode 100644 index 0000000..01fa832 --- /dev/null +++ b/src/services/inference-endpoints/models/inference-endpoints-list.ts @@ -0,0 +1,42 @@ +import { z } from 'zod'; +import { inferenceEndpoint, inferenceEndpointRequest, inferenceEndpointResponse } from './inference-endpoint'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const inferenceEndpointsList = z.lazy(() => { + return z.object({ + items: z.array(inferenceEndpoint).max(100), + }); +}); + +/** + * Represents a list of inference endpoints + * @typedef {InferenceEndpointsList} inferenceEndpointsList - Represents a list of inference endpoints - Represents a list of inference endpoints + * @property {InferenceEndpoint[]} - The list of items + */ +export type InferenceEndpointsList = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const inferenceEndpointsListResponse = z.lazy(() => { + return z + .object({ + items: z.array(inferenceEndpointResponse).max(100), + }) + .transform((data) => ({ + items: data['items'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const inferenceEndpointsListRequest = z.lazy(() => { + return z.object({ items: z.array(inferenceEndpointRequest).nullish() }).transform((data) => ({ + items: data['items'], + })); +}); diff --git a/src/services/inference-endpoints/request-params.ts b/src/services/inference-endpoints/request-params.ts new file mode 100644 index 0000000..94a6ae9 --- /dev/null +++ b/src/services/inference-endpoints/request-params.ts @@ -0,0 +1,9 @@ +export interface ListInferenceEndpointsParams { + page?: number; + pageSize?: number; +} + +export interface GetInferenceEndpointJobsParams { + page?: number; + pageSize?: number; +} diff --git a/src/services/organization-data/index.ts b/src/services/organization-data/index.ts new file mode 100644 index 0000000..02e0f23 --- /dev/null +++ b/src/services/organization-data/index.ts @@ -0,0 +1,2 @@ +export { OrganizationDataService } from './organization-data'; +export * from './models'; diff --git a/src/services/organization-data/models/gpu-class-price.ts b/src/services/organization-data/models/gpu-class-price.ts new file mode 100644 index 0000000..67ec857 --- /dev/null +++ b/src/services/organization-data/models/gpu-class-price.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const gpuClassPrice = z.lazy(() => { + return z.object({ + priority: z.string().nullable(), + price: z.string().min(1).max(20), + }); +}); + +/** + * Represents the price of a GPU class for a given container group priority + * @typedef {GpuClassPrice} gpuClassPrice - Represents the price of a GPU class for a given container group priority - Represents the price of a GPU class for a given container group priority + * @property {ContainerGroupPriority} + * @property {string} - The price + */ +export type GpuClassPrice = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const gpuClassPriceResponse = z.lazy(() => { + return z + .object({ + priority: z.string().nullable(), + price: z.string().min(1).max(20), + }) + .transform((data) => ({ + priority: data['priority'], + price: data['price'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const gpuClassPriceRequest = z.lazy(() => { + return z.object({ priority: z.string().nullish(), price: z.string().nullish() }).transform((data) => ({ + priority: data['priority'], + price: data['price'], + })); +}); diff --git a/src/services/organization-data/models/gpu-class.ts b/src/services/organization-data/models/gpu-class.ts new file mode 100644 index 0000000..506d5c9 --- /dev/null +++ b/src/services/organization-data/models/gpu-class.ts @@ -0,0 +1,64 @@ +import { z } from 'zod'; +import { gpuClassPrice, gpuClassPriceRequest, gpuClassPriceResponse } from './gpu-class-price'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const gpuClass = z.lazy(() => { + return z.object({ + id: z.string(), + name: z.string().min(2).max(63), + prices: z.array(gpuClassPrice).min(1).max(100), + isHighDemand: z.boolean().optional(), + }); +}); + +/** + * Represents a GPU Class + * @typedef {GpuClass} gpuClass - Represents a GPU Class - Represents a GPU Class + * @property {string} - The unique identifier + * @property {string} - The GPU class name + * @property {GpuClassPrice[]} - The list of prices for each container group priority + * @property {boolean} - Whether the GPU class is in high demand + */ +export type GpuClass = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const gpuClassResponse = z.lazy(() => { + return z + .object({ + id: z.string(), + name: z.string().min(2).max(63), + prices: z.array(gpuClassPriceResponse).min(1).max(100), + is_high_demand: z.boolean().optional(), + }) + .transform((data) => ({ + id: data['id'], + name: data['name'], + prices: data['prices'], + isHighDemand: data['is_high_demand'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const gpuClassRequest = z.lazy(() => { + return z + .object({ + id: z.string().nullish(), + name: z.string().nullish(), + prices: z.array(gpuClassPriceRequest).nullish(), + isHighDemand: z.boolean().nullish(), + }) + .transform((data) => ({ + id: data['id'], + name: data['name'], + prices: data['prices'], + is_high_demand: data['isHighDemand'], + })); +}); diff --git a/src/services/organization-data/models/gpu-classes-list.ts b/src/services/organization-data/models/gpu-classes-list.ts new file mode 100644 index 0000000..17335e3 --- /dev/null +++ b/src/services/organization-data/models/gpu-classes-list.ts @@ -0,0 +1,42 @@ +import { z } from 'zod'; +import { gpuClass, gpuClassRequest, gpuClassResponse } from './gpu-class'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const gpuClassesList = z.lazy(() => { + return z.object({ + items: z.array(gpuClass).max(100), + }); +}); + +/** + * Represents a list of GPU classes + * @typedef {GpuClassesList} gpuClassesList - Represents a list of GPU classes - Represents a list of GPU classes + * @property {GpuClass[]} - The list of GPU classes + */ +export type GpuClassesList = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const gpuClassesListResponse = z.lazy(() => { + return z + .object({ + items: z.array(gpuClassResponse).max(100), + }) + .transform((data) => ({ + items: data['items'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const gpuClassesListRequest = z.lazy(() => { + return z.object({ items: z.array(gpuClassRequest).nullish() }).transform((data) => ({ + items: data['items'], + })); +}); diff --git a/src/services/organization-data/models/index.ts b/src/services/organization-data/models/index.ts new file mode 100644 index 0000000..6035879 --- /dev/null +++ b/src/services/organization-data/models/index.ts @@ -0,0 +1,3 @@ +export type { GpuClassesList } from './gpu-classes-list'; +export type { GpuClass } from './gpu-class'; +export type { GpuClassPrice } from './gpu-class-price'; diff --git a/src/services/organization-data/organization-data.ts b/src/services/organization-data/organization-data.ts new file mode 100644 index 0000000..aeb9f37 --- /dev/null +++ b/src/services/organization-data/organization-data.ts @@ -0,0 +1,34 @@ +import { z } from 'zod'; +import { BaseService } from '../base-service'; +import { ContentType, HttpResponse, RequestConfig } from '../../http/types'; +import { RequestBuilder } from '../../http/transport/request-builder'; +import { SerializationStyle } from '../../http/serialization/base-serializer'; +import { GpuClassesList, gpuClassesListResponse } from './models/gpu-classes-list'; + +export class OrganizationDataService extends BaseService { + /** + * List the GPU Classes + * @param {string} organizationName - The unique organization name + * @returns {Promise>} OK + */ + async listGpuClasses(organizationName: string, requestConfig?: RequestConfig): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath('/organizations/{organization_name}/gpu-classes') + .setRequestSchema(z.any()) + .setResponseSchema(gpuClassesListResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .build(); + return this.client.call(request); + } +} diff --git a/src/services/queues/index.ts b/src/services/queues/index.ts new file mode 100644 index 0000000..53c9014 --- /dev/null +++ b/src/services/queues/index.ts @@ -0,0 +1,2 @@ +export { QueuesService } from './queues'; +export * from './models'; diff --git a/src/services/queues/models/create-queue-job.ts b/src/services/queues/models/create-queue-job.ts new file mode 100644 index 0000000..11822bd --- /dev/null +++ b/src/services/queues/models/create-queue-job.ts @@ -0,0 +1,53 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const createQueueJob = z.lazy(() => { + return z.object({ + input: z.any(), + metadata: z.any().optional().nullable(), + webhook: z.string().optional().nullable(), + }); +}); + +/** + * Represents a request to create a queue job + * @typedef {CreateQueueJob} createQueueJob - Represents a request to create a queue job - Represents a request to create a queue job + * @property {any} - The job input. May be any valid JSON. + * @property {any} + * @property {string} + */ +export type CreateQueueJob = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const createQueueJobResponse = z.lazy(() => { + return z + .object({ + input: z.any(), + metadata: z.any().optional().nullable(), + webhook: z.string().optional().nullable(), + }) + .transform((data) => ({ + input: data['input'], + metadata: data['metadata'], + webhook: data['webhook'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const createQueueJobRequest = z.lazy(() => { + return z + .object({ input: z.any().nullish(), metadata: z.any().nullish(), webhook: z.string().nullish() }) + .transform((data) => ({ + input: data['input'], + metadata: data['metadata'], + webhook: data['webhook'], + })); +}); diff --git a/src/services/queues/models/create-queue.ts b/src/services/queues/models/create-queue.ts new file mode 100644 index 0000000..9eaafc8 --- /dev/null +++ b/src/services/queues/models/create-queue.ts @@ -0,0 +1,73 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const createQueue = z.lazy(() => { + return z.object({ + name: z + .string() + .min(2) + .max(63) + .regex(/^[a-z][a-z0-9-]{0,61}[a-z0-9]$/), + displayName: z + .string() + .min(2) + .max(63) + .regex(/^[ ,-.0-9A-Za-z]+$/) + .optional() + .nullable(), + description: z.string().max(500).optional().nullable(), + }); +}); + +/** + * Represents a request to create a queue + * @typedef {CreateQueue} createQueue - Represents a request to create a queue - Represents a request to create a queue + * @property {string} + * @property {string} + * @property {string} - The description + */ +export type CreateQueue = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const createQueueResponse = z.lazy(() => { + return z + .object({ + name: z + .string() + .min(2) + .max(63) + .regex(/^[a-z][a-z0-9-]{0,61}[a-z0-9]$/), + display_name: z + .string() + .min(2) + .max(63) + .regex(/^[ ,-.0-9A-Za-z]+$/) + .optional() + .nullable(), + description: z.string().max(500).optional().nullable(), + }) + .transform((data) => ({ + name: data['name'], + displayName: data['display_name'], + description: data['description'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const createQueueRequest = z.lazy(() => { + return z + .object({ name: z.string().nullish(), displayName: z.string().nullish(), description: z.string().nullish() }) + .transform((data) => ({ + name: data['name'], + display_name: data['displayName'], + description: data['description'], + })); +}); diff --git a/src/services/queues/models/index.ts b/src/services/queues/models/index.ts new file mode 100644 index 0000000..c1dbed8 --- /dev/null +++ b/src/services/queues/models/index.ts @@ -0,0 +1,10 @@ +export type { QueueList } from './queue-list'; +export type { CreateQueue } from './create-queue'; +export type { Queue } from './queue'; +export type { UpdateQueue } from './update-queue'; +export type { QueueJobList } from './queue-job-list'; +export type { CreateQueueJob } from './create-queue-job'; +export type { QueueJob } from './queue-job'; +export { QueueJobStatus } from './queue-job-status'; +export type { QueueJobEvent } from './queue-job-event'; +export { QueueJobEventAction } from './queue-job-event-action'; diff --git a/src/services/queues/models/queue-job-event-action.ts b/src/services/queues/models/queue-job-event-action.ts new file mode 100644 index 0000000..711f291 --- /dev/null +++ b/src/services/queues/models/queue-job-event-action.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +export enum QueueJobEventAction { + CREATED = 'created', + STARTED = 'started', + SUCCEEDED = 'succeeded', + CANCELLED = 'cancelled', + FAILED = 'failed', +} diff --git a/src/services/queues/models/queue-job-event.ts b/src/services/queues/models/queue-job-event.ts new file mode 100644 index 0000000..8ff2ee9 --- /dev/null +++ b/src/services/queues/models/queue-job-event.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const queueJobEvent = z.lazy(() => { + return z.object({ + action: z.string(), + time: z.string(), + }); +}); + +/** + * Represents an event for queue job + * @typedef {QueueJobEvent} queueJobEvent - Represents an event for queue job - Represents an event for queue job + * @property {QueueJobEventAction} + * @property {string} + */ +export type QueueJobEvent = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const queueJobEventResponse = z.lazy(() => { + return z + .object({ + action: z.string(), + time: z.string(), + }) + .transform((data) => ({ + action: data['action'], + time: data['time'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const queueJobEventRequest = z.lazy(() => { + return z.object({ action: z.string().nullish(), time: z.string().nullish() }).transform((data) => ({ + action: data['action'], + time: data['time'], + })); +}); diff --git a/src/services/queues/models/queue-job-list.ts b/src/services/queues/models/queue-job-list.ts new file mode 100644 index 0000000..7b38c60 --- /dev/null +++ b/src/services/queues/models/queue-job-list.ts @@ -0,0 +1,42 @@ +import { z } from 'zod'; +import { queueJob, queueJobRequest, queueJobResponse } from './queue-job'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const queueJobList = z.lazy(() => { + return z.object({ + items: z.array(queueJob).max(100), + }); +}); + +/** + * Represents a list of queue jobs + * @typedef {QueueJobList} queueJobList - Represents a list of queue jobs - Represents a list of queue jobs + * @property {QueueJob[]} + */ +export type QueueJobList = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const queueJobListResponse = z.lazy(() => { + return z + .object({ + items: z.array(queueJobResponse).max(100), + }) + .transform((data) => ({ + items: data['items'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const queueJobListRequest = z.lazy(() => { + return z.object({ items: z.array(queueJobRequest).nullish() }).transform((data) => ({ + items: data['items'], + })); +}); diff --git a/src/services/queues/models/queue-job-status.ts b/src/services/queues/models/queue-job-status.ts new file mode 100644 index 0000000..97fd61a --- /dev/null +++ b/src/services/queues/models/queue-job-status.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +export enum QueueJobStatus { + PENDING = 'pending', + RUNNING = 'running', + SUCCEEDED = 'succeeded', + CANCELLED = 'cancelled', + FAILED = 'failed', +} diff --git a/src/services/queues/models/queue-job.ts b/src/services/queues/models/queue-job.ts new file mode 100644 index 0000000..c0d0eaf --- /dev/null +++ b/src/services/queues/models/queue-job.ts @@ -0,0 +1,94 @@ +import { z } from 'zod'; +import { queueJobEvent, queueJobEventRequest, queueJobEventResponse } from './queue-job-event'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const queueJob = z.lazy(() => { + return z.object({ + id: z.string(), + input: z.any(), + metadata: z.any().optional().nullable(), + webhook: z.string().optional().nullable(), + status: z.string(), + events: z.array(queueJobEvent).max(1000), + output: z.any().optional(), + createTime: z.string(), + updateTime: z.string(), + }); +}); + +/** + * Represents a queue job + * @typedef {QueueJob} queueJob - Represents a queue job - Represents a queue job + * @property {string} + * @property {any} - The job input. May be any valid JSON. + * @property {any} + * @property {string} + * @property {QueueJobStatus} + * @property {QueueJobEvent[]} + * @property {any} - The job output. May be any valid JSON. + * @property {string} + * @property {string} + */ +export type QueueJob = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const queueJobResponse = z.lazy(() => { + return z + .object({ + id: z.string(), + input: z.any(), + metadata: z.any().optional().nullable(), + webhook: z.string().optional().nullable(), + status: z.string(), + events: z.array(queueJobEventResponse).max(1000), + output: z.any().optional(), + create_time: z.string(), + update_time: z.string(), + }) + .transform((data) => ({ + id: data['id'], + input: data['input'], + metadata: data['metadata'], + webhook: data['webhook'], + status: data['status'], + events: data['events'], + output: data['output'], + createTime: data['create_time'], + updateTime: data['update_time'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const queueJobRequest = z.lazy(() => { + return z + .object({ + id: z.string().nullish(), + input: z.any().nullish(), + metadata: z.any().nullish(), + webhook: z.string().nullish(), + status: z.string().nullish(), + events: z.array(queueJobEventRequest).nullish(), + output: z.any().nullish(), + createTime: z.string().nullish(), + updateTime: z.string().nullish(), + }) + .transform((data) => ({ + id: data['id'], + input: data['input'], + metadata: data['metadata'], + webhook: data['webhook'], + status: data['status'], + events: data['events'], + output: data['output'], + create_time: data['createTime'], + update_time: data['updateTime'], + })); +}); diff --git a/src/services/queues/models/queue-list.ts b/src/services/queues/models/queue-list.ts new file mode 100644 index 0000000..b6d0d30 --- /dev/null +++ b/src/services/queues/models/queue-list.ts @@ -0,0 +1,42 @@ +import { z } from 'zod'; +import { queue, queueRequest, queueResponse } from './queue'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const queueList = z.lazy(() => { + return z.object({ + items: z.array(queue).max(100), + }); +}); + +/** + * Represents a list of queues + * @typedef {QueueList} queueList - Represents a list of queues - Represents a list of queues + * @property {Queue[]} + */ +export type QueueList = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const queueListResponse = z.lazy(() => { + return z + .object({ + items: z.array(queueResponse).max(100), + }) + .transform((data) => ({ + items: data['items'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const queueListRequest = z.lazy(() => { + return z.object({ items: z.array(queueRequest).nullish() }).transform((data) => ({ + items: data['items'], + })); +}); diff --git a/src/services/queues/models/queue.ts b/src/services/queues/models/queue.ts new file mode 100644 index 0000000..035d469 --- /dev/null +++ b/src/services/queues/models/queue.ts @@ -0,0 +1,98 @@ +import { z } from 'zod'; +import { containerGroup, containerGroupRequest, containerGroupResponse } from '../../common/container-group'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const queue = z.lazy(() => { + return z.object({ + id: z.string(), + name: z + .string() + .min(2) + .max(63) + .regex(/^[a-z][a-z0-9-]{0,61}[a-z0-9]$/), + displayName: z + .string() + .min(2) + .max(63) + .regex(/^[ ,-.0-9A-Za-z]+$/), + description: z.string().max(500).optional().nullable(), + containerGroups: z.array(containerGroup).max(100), + createTime: z.string(), + updateTime: z.string(), + }); +}); + +/** + * Represents a queue + * @typedef {Queue} queue - Represents a queue - Represents a queue + * @property {string} + * @property {string} + * @property {string} + * @property {string} - The description + * @property {ContainerGroup[]} + * @property {string} + * @property {string} + */ +export type Queue = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const queueResponse = z.lazy(() => { + return z + .object({ + id: z.string(), + name: z + .string() + .min(2) + .max(63) + .regex(/^[a-z][a-z0-9-]{0,61}[a-z0-9]$/), + display_name: z + .string() + .min(2) + .max(63) + .regex(/^[ ,-.0-9A-Za-z]+$/), + description: z.string().max(500).optional().nullable(), + container_groups: z.array(containerGroupResponse).max(100), + create_time: z.string(), + update_time: z.string(), + }) + .transform((data) => ({ + id: data['id'], + name: data['name'], + displayName: data['display_name'], + description: data['description'], + containerGroups: data['container_groups'], + createTime: data['create_time'], + updateTime: data['update_time'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const queueRequest = z.lazy(() => { + return z + .object({ + id: z.string().nullish(), + name: z.string().nullish(), + displayName: z.string().nullish(), + description: z.string().nullish(), + containerGroups: z.array(containerGroupRequest).nullish(), + createTime: z.string().nullish(), + updateTime: z.string().nullish(), + }) + .transform((data) => ({ + id: data['id'], + name: data['name'], + display_name: data['displayName'], + description: data['description'], + container_groups: data['containerGroups'], + create_time: data['createTime'], + update_time: data['updateTime'], + })); +}); diff --git a/src/services/queues/models/update-queue.ts b/src/services/queues/models/update-queue.ts new file mode 100644 index 0000000..2b0288e --- /dev/null +++ b/src/services/queues/models/update-queue.ts @@ -0,0 +1,58 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const updateQueue = z.lazy(() => { + return z.object({ + displayName: z + .string() + .min(2) + .max(63) + .regex(/^[ ,-.0-9A-Za-z]+$/) + .optional() + .nullable(), + description: z.string().max(500).optional().nullable(), + }); +}); + +/** + * Represents a request to update a queue + * @typedef {UpdateQueue} updateQueue - Represents a request to update a queue - Represents a request to update a queue + * @property {string} + * @property {string} - The description + */ +export type UpdateQueue = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const updateQueueResponse = z.lazy(() => { + return z + .object({ + display_name: z + .string() + .min(2) + .max(63) + .regex(/^[ ,-.0-9A-Za-z]+$/) + .optional() + .nullable(), + description: z.string().max(500).optional().nullable(), + }) + .transform((data) => ({ + displayName: data['display_name'], + description: data['description'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const updateQueueRequest = z.lazy(() => { + return z.object({ displayName: z.string().nullish(), description: z.string().nullish() }).transform((data) => ({ + display_name: data['displayName'], + description: data['description'], + })); +}); diff --git a/src/services/queues/queues.ts b/src/services/queues/queues.ts new file mode 100644 index 0000000..6c9f845 --- /dev/null +++ b/src/services/queues/queues.ts @@ -0,0 +1,404 @@ +import { z } from 'zod'; +import { BaseService } from '../base-service'; +import { ContentType, HttpResponse, RequestConfig } from '../../http/types'; +import { RequestBuilder } from '../../http/transport/request-builder'; +import { SerializationStyle } from '../../http/serialization/base-serializer'; +import { QueueList, queueListResponse } from './models/queue-list'; +import { CreateQueue, createQueueRequest } from './models/create-queue'; +import { Queue, queueResponse } from './models/queue'; +import { UpdateQueue, updateQueueRequest } from './models/update-queue'; +import { QueueJobList, queueJobListResponse } from './models/queue-job-list'; +import { ListQueueJobsParams } from './request-params'; +import { CreateQueueJob, createQueueJobRequest } from './models/create-queue-job'; +import { QueueJob, queueJobResponse } from './models/queue-job'; + +export class QueuesService extends BaseService { + /** + * Gets the list of queues + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @returns {Promise>} OK + */ + async listQueues( + organizationName: string, + projectName: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath('/organizations/{organization_name}/projects/{project_name}/queues') + .setRequestSchema(z.any()) + .setResponseSchema(queueListResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .build(); + return this.client.call(request); + } + + /** + * Creates a new queue + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @returns {Promise>} Created + */ + async createQueue( + organizationName: string, + projectName: string, + body: CreateQueue, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('POST') + .setPath('/organizations/{organization_name}/projects/{project_name}/queues') + .setRequestSchema(createQueueRequest) + .setResponseSchema(queueResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) + .addBody(body) + .build(); + return this.client.call(request); + } + + /** + * Gets a queue + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} queueName - The unique queue name + * @returns {Promise>} OK + */ + async getQueue( + organizationName: string, + projectName: string, + queueName: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath('/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}') + .setRequestSchema(z.any()) + .setResponseSchema(queueResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'queue_name', + value: queueName, + }) + .build(); + return this.client.call(request); + } + + /** + * Updates a queue + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} queueName - The unique queue name + * @returns {Promise>} OK + */ + async updateQueue( + organizationName: string, + projectName: string, + queueName: string, + body: UpdateQueue, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('PATCH') + .setPath('/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}') + .setRequestSchema(updateQueueRequest) + .setResponseSchema(queueResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'queue_name', + value: queueName, + }) + .addHeaderParam({ key: 'Content-Type', value: 'application/merge-patch+json' }) + .addBody(body) + .build(); + return this.client.call(request); + } + + /** + * Deletes a queue + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} queueName - The unique queue name + * @returns {Promise>} Accepted + */ + async deleteQueue( + organizationName: string, + projectName: string, + queueName: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('DELETE') + .setPath('/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}') + .setRequestSchema(z.any()) + .setResponseSchema(z.undefined()) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'queue_name', + value: queueName, + }) + .build(); + return this.client.call(request); + } + + /** + * Retrieves a list of queue jobs + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} queueName - The unique queue name + * @param {number} [page] - The page number + * @param {number} [pageSize] - The number of items per page + * @returns {Promise>} OK + */ + async listQueueJobs( + organizationName: string, + projectName: string, + queueName: string, + params?: ListQueueJobsParams, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath('/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs') + .setRequestSchema(z.any()) + .setResponseSchema(queueJobListResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'queue_name', + value: queueName, + }) + .addQueryParam({ + key: 'page', + value: params?.page, + }) + .addQueryParam({ + key: 'page_size', + value: params?.pageSize, + }) + .build(); + return this.client.call(request); + } + + /** + * Creates a new job + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} queueName - The unique queue name + * @returns {Promise>} Created + */ + async createQueueJob( + organizationName: string, + projectName: string, + queueName: string, + body: CreateQueueJob, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('POST') + .setPath('/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs') + .setRequestSchema(createQueueJobRequest) + .setResponseSchema(queueJobResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'queue_name', + value: queueName, + }) + .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) + .addBody(body) + .build(); + return this.client.call(request); + } + + /** + * Retrieves a job in a queue + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} queueName - The unique queue name + * @param {string} queueJobId - The unique job id + * @returns {Promise>} OK + */ + async getQueueJob( + organizationName: string, + projectName: string, + queueName: string, + queueJobId: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath('/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs/{queue_job_id}') + .setRequestSchema(z.any()) + .setResponseSchema(queueJobResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'queue_name', + value: queueName, + }) + .addPathParam({ + key: 'queue_job_id', + value: queueJobId, + }) + .build(); + return this.client.call(request); + } + + /** + * Deletes a queue job + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} queueName - The unique queue name + * @param {string} queueJobId - The unique job id + * @returns {Promise>} Accepted + */ + async deleteQueueJob( + organizationName: string, + projectName: string, + queueName: string, + queueJobId: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('DELETE') + .setPath('/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs/{queue_job_id}') + .setRequestSchema(z.any()) + .setResponseSchema(z.undefined()) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'queue_name', + value: queueName, + }) + .addPathParam({ + key: 'queue_job_id', + value: queueJobId, + }) + .build(); + return this.client.call(request); + } +} diff --git a/src/services/queues/request-params.ts b/src/services/queues/request-params.ts new file mode 100644 index 0000000..a03fcd8 --- /dev/null +++ b/src/services/queues/request-params.ts @@ -0,0 +1,4 @@ +export interface ListQueueJobsParams { + page?: number; + pageSize?: number; +} diff --git a/src/services/quotas/index.ts b/src/services/quotas/index.ts new file mode 100644 index 0000000..db380b8 --- /dev/null +++ b/src/services/quotas/index.ts @@ -0,0 +1,2 @@ +export { QuotasService } from './quotas'; +export * from './models'; diff --git a/src/services/quotas/models/container-groups-quotas.ts b/src/services/quotas/models/container-groups-quotas.ts new file mode 100644 index 0000000..fe54a80 --- /dev/null +++ b/src/services/quotas/models/container-groups-quotas.ts @@ -0,0 +1,69 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const containerGroupsQuotas = z.lazy(() => { + return z.object({ + maxCreatedContainerGroups: z.number(), + containerInstanceQuota: z.number(), + maxContainerGroupReallocationsPerMinute: z.number().gte(0).optional(), + maxContainerGroupRecreatesPerMinute: z.number().gte(0).optional(), + maxContainerGroupRestartsPerMinute: z.number().gte(0).optional(), + }); +}); + +/** + * + * @typedef {ContainerGroupsQuotas} containerGroupsQuotas + * @property {number} + * @property {number} + * @property {number} + * @property {number} + * @property {number} + */ +export type ContainerGroupsQuotas = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupsQuotasResponse = z.lazy(() => { + return z + .object({ + max_created_container_groups: z.number(), + container_instance_quota: z.number(), + max_container_group_reallocations_per_minute: z.number().gte(0).optional(), + max_container_group_recreates_per_minute: z.number().gte(0).optional(), + max_container_group_restarts_per_minute: z.number().gte(0).optional(), + }) + .transform((data) => ({ + maxCreatedContainerGroups: data['max_created_container_groups'], + containerInstanceQuota: data['container_instance_quota'], + maxContainerGroupReallocationsPerMinute: data['max_container_group_reallocations_per_minute'], + maxContainerGroupRecreatesPerMinute: data['max_container_group_recreates_per_minute'], + maxContainerGroupRestartsPerMinute: data['max_container_group_restarts_per_minute'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const containerGroupsQuotasRequest = z.lazy(() => { + return z + .object({ + maxCreatedContainerGroups: z.number().nullish(), + containerInstanceQuota: z.number().nullish(), + maxContainerGroupReallocationsPerMinute: z.number().nullish(), + maxContainerGroupRecreatesPerMinute: z.number().nullish(), + maxContainerGroupRestartsPerMinute: z.number().nullish(), + }) + .transform((data) => ({ + max_created_container_groups: data['maxCreatedContainerGroups'], + container_instance_quota: data['containerInstanceQuota'], + max_container_group_reallocations_per_minute: data['maxContainerGroupReallocationsPerMinute'], + max_container_group_recreates_per_minute: data['maxContainerGroupRecreatesPerMinute'], + max_container_group_restarts_per_minute: data['maxContainerGroupRestartsPerMinute'], + })); +}); diff --git a/src/services/quotas/models/index.ts b/src/services/quotas/models/index.ts new file mode 100644 index 0000000..99b19b8 --- /dev/null +++ b/src/services/quotas/models/index.ts @@ -0,0 +1,3 @@ +export type { Quotas } from './quotas'; +export type { ContainerGroupsQuotas } from './container-groups-quotas'; +export type { RecipesQuotas } from './recipes-quotas'; diff --git a/src/services/quotas/models/quotas.ts b/src/services/quotas/models/quotas.ts new file mode 100644 index 0000000..4b4ca7d --- /dev/null +++ b/src/services/quotas/models/quotas.ts @@ -0,0 +1,69 @@ +import { z } from 'zod'; +import { + containerGroupsQuotas, + containerGroupsQuotasRequest, + containerGroupsQuotasResponse, +} from './container-groups-quotas'; +import { recipesQuotas, recipesQuotasRequest, recipesQuotasResponse } from './recipes-quotas'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const quotas = z.lazy(() => { + return z.object({ + containerGroupsQuotas: containerGroupsQuotas, + createTime: z.string().optional(), + recipesQuotas: recipesQuotas, + updateTime: z.string().optional(), + }); +}); + +/** + * Represents the organization quotas + * @typedef {Quotas} quotas - Represents the organization quotas - Represents the organization quotas + * @property {ContainerGroupsQuotas} + * @property {string} - The time the resource was created + * @property {RecipesQuotas} + * @property {string} - The time the resource was last updated + */ +export type Quotas = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const quotasResponse = z.lazy(() => { + return z + .object({ + container_groups_quotas: containerGroupsQuotasResponse, + create_time: z.string().optional(), + recipes_quotas: recipesQuotasResponse, + update_time: z.string().optional(), + }) + .transform((data) => ({ + containerGroupsQuotas: data['container_groups_quotas'], + createTime: data['create_time'], + recipesQuotas: data['recipes_quotas'], + updateTime: data['update_time'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const quotasRequest = z.lazy(() => { + return z + .object({ + containerGroupsQuotas: containerGroupsQuotasRequest.nullish(), + createTime: z.string().nullish(), + recipesQuotas: recipesQuotasRequest.nullish(), + updateTime: z.string().nullish(), + }) + .transform((data) => ({ + container_groups_quotas: data['containerGroupsQuotas'], + create_time: data['createTime'], + recipes_quotas: data['recipesQuotas'], + update_time: data['updateTime'], + })); +}); diff --git a/src/services/quotas/models/recipes-quotas.ts b/src/services/quotas/models/recipes-quotas.ts new file mode 100644 index 0000000..463bf02 --- /dev/null +++ b/src/services/quotas/models/recipes-quotas.ts @@ -0,0 +1,48 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const recipesQuotas = z.lazy(() => { + return z.object({ + maxCreatedRecipeDeployments: z.number(), + recipeInstanceQuota: z.number(), + }); +}); + +/** + * + * @typedef {RecipesQuotas} recipesQuotas + * @property {number} + * @property {number} + */ +export type RecipesQuotas = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const recipesQuotasResponse = z.lazy(() => { + return z + .object({ + max_created_recipe_deployments: z.number(), + recipe_instance_quota: z.number(), + }) + .transform((data) => ({ + maxCreatedRecipeDeployments: data['max_created_recipe_deployments'], + recipeInstanceQuota: data['recipe_instance_quota'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const recipesQuotasRequest = z.lazy(() => { + return z + .object({ maxCreatedRecipeDeployments: z.number().nullish(), recipeInstanceQuota: z.number().nullish() }) + .transform((data) => ({ + max_created_recipe_deployments: data['maxCreatedRecipeDeployments'], + recipe_instance_quota: data['recipeInstanceQuota'], + })); +}); diff --git a/src/services/quotas/quotas.ts b/src/services/quotas/quotas.ts new file mode 100644 index 0000000..9b23e7c --- /dev/null +++ b/src/services/quotas/quotas.ts @@ -0,0 +1,34 @@ +import { z } from 'zod'; +import { BaseService } from '../base-service'; +import { ContentType, HttpResponse, RequestConfig } from '../../http/types'; +import { RequestBuilder } from '../../http/transport/request-builder'; +import { SerializationStyle } from '../../http/serialization/base-serializer'; +import { Quotas, quotasResponse } from './models/quotas'; + +export class QuotasService extends BaseService { + /** + * Gets the organization quotas + * @param {string} organizationName - The unique organization name + * @returns {Promise>} OK + */ + async getQuotas(organizationName: string, requestConfig?: RequestConfig): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath('/organizations/{organization_name}/quotas') + .setRequestSchema(z.any()) + .setResponseSchema(quotasResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .build(); + return this.client.call(request); + } +} diff --git a/src/services/webhook-secret-key/index.ts b/src/services/webhook-secret-key/index.ts new file mode 100644 index 0000000..ef97f00 --- /dev/null +++ b/src/services/webhook-secret-key/index.ts @@ -0,0 +1,2 @@ +export { WebhookSecretKeyService } from './webhook-secret-key'; +export * from './models'; diff --git a/src/services/webhook-secret-key/models/index.ts b/src/services/webhook-secret-key/models/index.ts new file mode 100644 index 0000000..bb391e7 --- /dev/null +++ b/src/services/webhook-secret-key/models/index.ts @@ -0,0 +1 @@ +export type { WebhookSecretKey } from './webhook-secret-key'; diff --git a/src/services/webhook-secret-key/models/webhook-secret-key.ts b/src/services/webhook-secret-key/models/webhook-secret-key.ts new file mode 100644 index 0000000..bb91f06 --- /dev/null +++ b/src/services/webhook-secret-key/models/webhook-secret-key.ts @@ -0,0 +1,41 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const webhookSecretKey = z.lazy(() => { + return z.object({ + secretKey: z.string(), + }); +}); + +/** + * Represents a webhook secret key + * @typedef {WebhookSecretKey} webhookSecretKey - Represents a webhook secret key - Represents a webhook secret key + * @property {string} - The webhook secret key + */ +export type WebhookSecretKey = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const webhookSecretKeyResponse = z.lazy(() => { + return z + .object({ + secret_key: z.string(), + }) + .transform((data) => ({ + secretKey: data['secret_key'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const webhookSecretKeyRequest = z.lazy(() => { + return z.object({ secretKey: z.string().nullish() }).transform((data) => ({ + secret_key: data['secretKey'], + })); +}); diff --git a/src/services/webhook-secret-key/webhook-secret-key.ts b/src/services/webhook-secret-key/webhook-secret-key.ts new file mode 100644 index 0000000..a63be6d --- /dev/null +++ b/src/services/webhook-secret-key/webhook-secret-key.ts @@ -0,0 +1,66 @@ +import { z } from 'zod'; +import { BaseService } from '../base-service'; +import { ContentType, HttpResponse, RequestConfig } from '../../http/types'; +import { RequestBuilder } from '../../http/transport/request-builder'; +import { SerializationStyle } from '../../http/serialization/base-serializer'; +import { WebhookSecretKey, webhookSecretKeyResponse } from './models/webhook-secret-key'; + +export class WebhookSecretKeyService extends BaseService { + /** + * Gets the webhook secret key + * @param {string} organizationName - The unique organization name + * @returns {Promise>} OK + */ + async getWebhookSecretKey( + organizationName: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath('/organizations/{organization_name}/webhook-secret-key') + .setRequestSchema(z.any()) + .setResponseSchema(webhookSecretKeyResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .build(); + return this.client.call(request); + } + + /** + * Updates the webhook secret key + * @param {string} organizationName - The unique organization name + * @returns {Promise>} OK + */ + async updateWebhookSecretKey( + organizationName: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('POST') + .setPath('/organizations/{organization_name}/webhook-secret-key') + .setRequestSchema(z.any()) + .setResponseSchema(webhookSecretKeyResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .build(); + return this.client.call(request); + } +} diff --git a/src/services/workload-errors/index.ts b/src/services/workload-errors/index.ts new file mode 100644 index 0000000..230b609 --- /dev/null +++ b/src/services/workload-errors/index.ts @@ -0,0 +1,2 @@ +export { WorkloadErrorsService } from './workload-errors'; +export * from './models'; diff --git a/src/services/workload-errors/models/index.ts b/src/services/workload-errors/models/index.ts new file mode 100644 index 0000000..8991c71 --- /dev/null +++ b/src/services/workload-errors/models/index.ts @@ -0,0 +1,2 @@ +export type { WorkloadErrorList } from './workload-error-list'; +export type { WorkloadError } from './workload-error'; diff --git a/src/services/workload-errors/models/workload-error-list.ts b/src/services/workload-errors/models/workload-error-list.ts new file mode 100644 index 0000000..d461513 --- /dev/null +++ b/src/services/workload-errors/models/workload-error-list.ts @@ -0,0 +1,42 @@ +import { z } from 'zod'; +import { workloadError, workloadErrorRequest, workloadErrorResponse } from './workload-error'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const workloadErrorList = z.lazy(() => { + return z.object({ + items: z.array(workloadError).max(50), + }); +}); + +/** + * Represents a list of workload errors + * @typedef {WorkloadErrorList} workloadErrorList - Represents a list of workload errors - Represents a list of workload errors + * @property {WorkloadError[]} + */ +export type WorkloadErrorList = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const workloadErrorListResponse = z.lazy(() => { + return z + .object({ + items: z.array(workloadErrorResponse).max(50), + }) + .transform((data) => ({ + items: data['items'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const workloadErrorListRequest = z.lazy(() => { + return z.object({ items: z.array(workloadErrorRequest).nullish() }).transform((data) => ({ + items: data['items'], + })); +}); diff --git a/src/services/workload-errors/models/workload-error.ts b/src/services/workload-errors/models/workload-error.ts new file mode 100644 index 0000000..b4048d1 --- /dev/null +++ b/src/services/workload-errors/models/workload-error.ts @@ -0,0 +1,81 @@ +import { z } from 'zod'; + +/** + * The shape of the model inside the application code - what the users use + */ +export const workloadError = z.lazy(() => { + return z.object({ + detail: z.string(), + failedAt: z.string(), + instanceId: z.string(), + machineId: z.string(), + allocatedAt: z.string(), + startedAt: z.string().optional().nullable(), + version: z.number().gte(1), + }); +}); + +/** + * Represents a workload error + * @typedef {WorkloadError} workloadError - Represents a workload error - Represents a workload error + * @property {string} + * @property {string} + * @property {string} + * @property {string} + * @property {string} + * @property {string} + * @property {number} + */ +export type WorkloadError = z.infer; + +/** + * The shape of the model mapping from the api schema into the application shape. + * Is equal to application shape if all property names match the api schema + */ +export const workloadErrorResponse = z.lazy(() => { + return z + .object({ + detail: z.string(), + failed_at: z.string(), + instance_id: z.string(), + machine_id: z.string(), + allocated_at: z.string(), + started_at: z.string().optional().nullable(), + version: z.number().gte(1), + }) + .transform((data) => ({ + detail: data['detail'], + failedAt: data['failed_at'], + instanceId: data['instance_id'], + machineId: data['machine_id'], + allocatedAt: data['allocated_at'], + startedAt: data['started_at'], + version: data['version'], + })); +}); + +/** + * The shape of the model mapping from the application shape into the api schema. + * Is equal to application shape if all property names match the api schema + */ +export const workloadErrorRequest = z.lazy(() => { + return z + .object({ + detail: z.string().nullish(), + failedAt: z.string().nullish(), + instanceId: z.string().nullish(), + machineId: z.string().nullish(), + allocatedAt: z.string().nullish(), + startedAt: z.string().nullish(), + version: z.number().nullish(), + }) + .transform((data) => ({ + detail: data['detail'], + failed_at: data['failedAt'], + instance_id: data['instanceId'], + machine_id: data['machineId'], + allocated_at: data['allocatedAt'], + started_at: data['startedAt'], + version: data['version'], + })); +}); diff --git a/src/services/workload-errors/workload-errors.ts b/src/services/workload-errors/workload-errors.ts new file mode 100644 index 0000000..9c75d32 --- /dev/null +++ b/src/services/workload-errors/workload-errors.ts @@ -0,0 +1,49 @@ +import { z } from 'zod'; +import { BaseService } from '../base-service'; +import { ContentType, HttpResponse, RequestConfig } from '../../http/types'; +import { RequestBuilder } from '../../http/transport/request-builder'; +import { SerializationStyle } from '../../http/serialization/base-serializer'; +import { WorkloadErrorList, workloadErrorListResponse } from './models/workload-error-list'; + +export class WorkloadErrorsService extends BaseService { + /** + * Gets the workload errors + * @param {string} organizationName - The unique organization name + * @param {string} projectName - The unique project name + * @param {string} containerGroupName - The unique container group name + * @returns {Promise>} OK + */ + async getWorkloadErrors( + organizationName: string, + projectName: string, + containerGroupName: string, + requestConfig?: RequestConfig, + ): Promise> { + const request = new RequestBuilder() + .setConfig(this.config) + .setBaseUrl(this.config) + .setMethod('GET') + .setPath('/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/errors') + .setRequestSchema(z.any()) + .setResponseSchema(workloadErrorListResponse) + .setRequestContentType(ContentType.Json) + .setResponseContentType(ContentType.Json) + .setRetryAttempts(this.config, requestConfig) + .setRetryDelayMs(this.config, requestConfig) + .setResponseValidation(this.config, requestConfig) + .addPathParam({ + key: 'organization_name', + value: organizationName, + }) + .addPathParam({ + key: 'project_name', + value: projectName, + }) + .addPathParam({ + key: 'container_group_name', + value: containerGroupName, + }) + .build(); + return this.client.call(request); + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..78eb691 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "es2018", + "module": "Node16", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "outDir": "./dist", + "rootDir": "./src", + "noImplicitAny": true, + "baseUrl": "./", + "declaration": true, + "moduleResolution": "Node16", + "isolatedModules": true, + "allowSyntheticDefaultImports": true, + "declarationMap": true, + "lib": ["es2017", "dom"], + "sourceMap": true + }, + "include": ["src/"] +}